mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed handling of the disabled option for yumpkg
It wasn't possible do set enabled back to 1 via state files. So if you once disabled a repository you couldn't enable it again. This line fixes all the weird behaviour in simply converting disabled=True/False to enabled=0/1 respectively.
This commit is contained in:
parent
28cc054244
commit
0829143dd1
1 changed files with 3 additions and 7 deletions
|
@ -2206,13 +2206,9 @@ def mod_repo(repo, basedir=None, **kwargs):
|
|||
del repo_opts[key]
|
||||
todelete.append(key)
|
||||
|
||||
# convert disabled=True to enabled=0 from pkgrepo state
|
||||
if 'disabled' in repo_opts:
|
||||
kw_disabled = repo_opts['disabled']
|
||||
if kw_disabled is True or str(kw_disabled).lower() == 'true':
|
||||
repo_opts['enabled'] = 0
|
||||
del repo_opts['disabled']
|
||||
todelete.append('disabled')
|
||||
# convert disabled to enabled respectively from pkgrepo state
|
||||
if 'enabled' not in repo_opts:
|
||||
repo_opts['enabled'] = int(str(repo_opts.pop('disabled', False)).lower() != 'true')
|
||||
|
||||
# Add baseurl or mirrorlist to the 'todelete' list if the other was
|
||||
# specified in the repo_opts
|
||||
|
|
Loading…
Add table
Reference in a new issue