From fcc7befd0fed57165b9ce039f1c3c8fb6e39c0c2 Mon Sep 17 00:00:00 2001 From: jacky06 Date: Wed, 19 Jun 2019 01:04:10 +0800 Subject: Cleanup of .keys() from dict_object.keys() *in* operator Change-Id: I49bb58e5dc2618ee02424315e4e3bf1057a77068 --- heatclient/common/base.py | 2 +- heatclient/common/utils.py | 2 +- heatclient/osc/v1/software_deployment.py | 2 +- heatclient/v1/shell.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'heatclient') diff --git a/heatclient/common/base.py b/heatclient/common/base.py index cca6a43..e881511 100644 --- a/heatclient/common/base.py +++ b/heatclient/common/base.py @@ -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) diff --git a/heatclient/common/utils.py b/heatclient/common/utils.py index c9d1ec0..ae32514 100644 --- a/heatclient/common/utils.py +++ b/heatclient/common/utils.py @@ -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: diff --git a/heatclient/osc/v1/software_deployment.py b/heatclient/osc/v1/software_deployment.py index eccab42..825d8fb 100644 --- a/heatclient/osc/v1/software_deployment.py +++ b/heatclient/osc/v1/software_deployment.py @@ -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: diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index 66d9651..9719795 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -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 -- cgit v1.2.1