From f519a9d44c6c2b1049a7751216de001b11fae718 Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Wed, 19 Aug 2020 14:13:47 +0530 Subject: [PATCH] Fix pep8 E741 errors --- gnocchiclient/utils.py | 8 ++++---- gnocchiclient/v1/resource_cli.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gnocchiclient/utils.py b/gnocchiclient/utils.py index 71ce37d..1123881 100644 --- a/gnocchiclient/utils.py +++ b/gnocchiclient/utils.py @@ -38,15 +38,15 @@ def list2cols(cols, objs): for o in objs] -def format_string_list(l): - return ", ".join(l) +def format_string_list(li): + return ", ".join(li) -def format_dict_list(l): +def format_dict_list(li): return "\n".join( "- " + ", ".join("%s: %s" % (k, v) for k, v in elem.items()) - for elem in l) + for elem in li) def format_dict_dict(value): diff --git a/gnocchiclient/v1/resource_cli.py b/gnocchiclient/v1/resource_cli.py index 5ed3c9c..380f973 100644 --- a/gnocchiclient/v1/resource_cli.py +++ b/gnocchiclient/v1/resource_cli.py @@ -198,10 +198,10 @@ def _resource_from_args(self, parsed_args, update=False): resource['metrics'][name] = value for metric in parsed_args.create_metric: name, _, value = metric.partition(":") - if value is "": - resource['metrics'][name] = {} - else: + if value: resource['metrics'][name] = {'archive_policy_name': value} + else: + resource['metrics'][name] = {} return resource