mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #47708 from darkpixel/47696-do-not-enumerate-none
Wrap properties loop with a check for None. Closes GH-47696
This commit is contained in:
commit
518f7bcc62
1 changed files with 9 additions and 8 deletions
|
@ -196,16 +196,17 @@ def present(name, properties=None, filesystem_properties=None, layout=None, conf
|
|||
|
||||
# figure out if updates needed
|
||||
properties_update = []
|
||||
for prop in properties:
|
||||
if prop not in properties_current:
|
||||
continue
|
||||
if properties:
|
||||
for prop in properties:
|
||||
if prop not in properties_current:
|
||||
continue
|
||||
|
||||
value = properties[prop]
|
||||
if isinstance(value, bool):
|
||||
value = 'on' if value else 'off'
|
||||
value = properties[prop]
|
||||
if isinstance(value, bool):
|
||||
value = 'on' if value else 'off'
|
||||
|
||||
if properties_current[prop] != value:
|
||||
properties_update.append(prop)
|
||||
if properties_current[prop] != value:
|
||||
properties_update.append(prop)
|
||||
|
||||
# update properties
|
||||
for prop in properties_update:
|
||||
|
|
Loading…
Add table
Reference in a new issue