heat engine : Resource remove redundant None get defaults
get(k) returns None anyway if k doesn't exist, so the default to None is not needed Change-Id: Id954c510a5c4795b5e0c3ccdcca186983dee2e8f Signed-off-by: Steven Hardy <shardy@redhat.com>
This commit is contained in:
parent
a43fcaab7b
commit
099fc71fa1
|
@ -194,15 +194,15 @@ class Resource(object):
|
||||||
|
|
||||||
# Create a set of keys which differ (or are missing/added)
|
# Create a set of keys which differ (or are missing/added)
|
||||||
changed_keys_set = set([k for k in template_keys
|
changed_keys_set = set([k for k in template_keys
|
||||||
if current_snippet.get(k, None) !=
|
if current_snippet.get(k) !=
|
||||||
json_snippet.get(k, None)])
|
json_snippet.get(k)])
|
||||||
|
|
||||||
if not changed_keys_set.issubset(update_allowed_set):
|
if not changed_keys_set.issubset(update_allowed_set):
|
||||||
badkeys = changed_keys_set - update_allowed_set
|
badkeys = changed_keys_set - update_allowed_set
|
||||||
raise NotImplementedError("Cannot update keys %s for %s" %
|
raise NotImplementedError("Cannot update keys %s for %s" %
|
||||||
(badkeys, self.name))
|
(badkeys, self.name))
|
||||||
|
|
||||||
return dict((k, json_snippet.get(k, None)) for k in changed_keys_set)
|
return dict((k, json_snippet.get(k)) for k in changed_keys_set)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '%s "%s"' % (self.__class__.__name__, self.name)
|
return '%s "%s"' % (self.__class__.__name__, self.name)
|
||||||
|
|
Loading…
Reference in New Issue