8000 [Backport] Modules: scm_track - Fix pushing to repositories by SchoolGuy · Pull Request #3622 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Backport] Modules: scm_track - Fix pushing to repositories #3622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3621.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scm_track: Pushing to remote repositories via the "scm_push_script" settings works again
6 changes: 3 additions & 3 deletions cobbler/modules/scm_track.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def run(api, args):
utils.subprocess_call(["git", "commit", "-m", "API update", "--author", author], shell=False)

if push_script:
utils.subprocess_call([push_script], shell=False)
utils.subprocess_call(push_script.split(" "), shell=False)

os.chdir(old_dir)
return 0
Expand All @@ -89,10 +89,10 @@ def run(api, args):
utils.subprocess_call(["hg", "add collections"], shell=False)
utils.subprocess_call(["hg", "add templates"], shell=False)
utils.subprocess_call(["hg", "add snippets"], shell=False)
utils.subprocess_call(["hg", "commit", "-m", "API", "update", "--user", author], shell=False)
utils.subprocess_call(["hg", "commit", "-m", "API update", "--user", author], shell=False)

if push_script:
utils.subprocess_call([push_script], shell=False)
utils.subprocess_call(push_script.split(" "), shell=False)

os.chdir(old_dir)
return 0
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,10 @@ def run(self):
],
extras_require={
"lint": ["pyflakes", "pycodestyle"],
"test": ["pytest", "pytest-cov", "codecov", "pytest-mock"]
"test": ["pytest", "pytest-cov", "codecov", "pytest-mock"],
# We require the current version to properly detect duplicate issues
# See: https://github.com/twisted/towncrier/releases/tag/22.8.0
"changelog": ["towncrier>=22.8.0"],
},
packages=find_packages(exclude=["*tests*"]),
scripts=[
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/scm_track_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_run_hg(mocker):
mocker.call(["hg", "add collections"], shell=False),
mocker.call(["hg", "add templates"], shell=False),
mocker.call(["hg", "add snippets"], shell=False),
mocker.call(["hg", "commit", "-m", "API", "update", "--user", settings_mock.scm_track_author], shell=False),
mocker.call(["hg", "commit", "-m", "API update", "--user", settings_mock.scm_track_author], shell=False),
mocker.call(["/bin/true"], shell=False)]
)
assert result == 0
0