mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Remove zypper's raise exception if mod_repo has no arguments and/or no changes
This commit is contained in:
parent
a0b128a85a
commit
3f00c6997a
1 changed files with 7 additions and 4 deletions
|
@ -806,6 +806,7 @@ def mod_repo(repo, **kwargs):
|
|||
cmd_opt = global_cmd_opt + ['mr'] + cmd_opt + [repo]
|
||||
__zypper__.refreshable.xml.call(*cmd_opt)
|
||||
|
||||
comment = None
|
||||
if call_refresh:
|
||||
# when used with "zypper ar --refresh" or "zypper mr --refresh"
|
||||
# --gpg-auto-import-keys is not doing anything
|
||||
|
@ -813,11 +814,13 @@ def mod_repo(repo, **kwargs):
|
|||
refresh_opts = global_cmd_opt + ['refresh'] + [repo]
|
||||
__zypper__.xml.call(*refresh_opts)
|
||||
elif not added and not cmd_opt:
|
||||
raise CommandExecutionError(
|
||||
'Specified arguments did not result in modification of repo'
|
||||
)
|
||||
comment = 'Specified arguments did not result in modification of repo'
|
||||
|
||||
return get_repo(repo)
|
||||
repo = get_repo(repo)
|
||||
if comment:
|
||||
repo['comment'] = comment
|
||||
|
||||
return repo
|
||||
|
||||
|
||||
def refresh_db():
|
||||
|
|
Loading…
Add table
Reference in a new issue