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:
Nicole Thomas 2018-05-18 11:25:43 -04:00 committed by GitHub
commit 518f7bcc62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: