Cleanup of .keys() from dict_object.keys() *in* operator

Change-Id: I49bb58e5dc2618ee02424315e4e3bf1057a77068
This commit is contained in:
jacky06
2019-06-19 01:04:10 +08:00
parent ee0e186e4c
commit fcc7befd0f
4 changed files with 4 additions and 4 deletions

View File

@@ -435,7 +435,7 @@ class Resource(object):
def __repr__(self):
reprkeys = sorted(k
for k in self.__dict__.keys()
for k in self.__dict__
if k[0] != '_' and k != 'manager')
info = ", ".join("%s=%s" % (k, getattr(self, k)) for k in reprkeys)
class_name = reflection.get_class_name(self, fully_qualified=False)

View File

@@ -170,7 +170,7 @@ def print_dict(d, formatters=None):
caching=False, print_empty=False)
pt.align = 'l'
for field in d.keys():
for field in d:
if field in formatters:
pt.add_row([field, formatters[field](d[field])])
else:

View File

@@ -340,7 +340,7 @@ class ShowOutputDeployment(command.Command):
if outputs:
if parsed_args.all:
print('output_values:\n')
for k in outputs.keys():
for k in outputs:
format_utils.print_software_deployment_output(
data=outputs, name=k, long=parsed_args.long)
else:

View File

@@ -564,7 +564,7 @@ def do_stack_update(hc, args):
fields = ['state', 'resource_name', 'resource_type',
'resource_identity']
for k in resource_changes.get("resource_changes", {}).keys():
for k in resource_changes.get("resource_changes", {}):
for i in range(len(resource_changes["resource_changes"][k])):
resource_changes["resource_changes"][k][i]['state'] = k