diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2023-05-08 11:34:37 +0100 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2023-05-10 10:51:30 +0100 |
| commit | 7ca43885c26d9dd7903e7015c0a31f3486730eea (patch) | |
| tree | fe4bb785229fe2d904d523a147559a83e6e32411 /openstackclient/image/v2 | |
| parent | 329296cedd0a64e9f65b080cef749b65256db85b (diff) | |
| download | python-openstackclient-7ca43885c26d9dd7903e7015c0a31f3486730eea.tar.gz | |
Blacken openstackclient.image
Black used with the '-l 79 -S' flags.
A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.
Change-Id: I6420ec6fd550903b03083b9b1f8391511913c86f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/image/v2')
| -rw-r--r-- | openstackclient/image/v2/image.py | 12 | ||||
| -rw-r--r-- | openstackclient/image/v2/metadef_namespaces.py | 46 |
2 files changed, 27 insertions, 31 deletions
diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index da26e918..8a0066ca 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -506,8 +506,8 @@ class CreateImage(command.ShowOne): raise exceptions.CommandError(msg) if ( - len(parsed_args.sign_key_path) < 1 or - len(parsed_args.sign_cert_id) < 1 + len(parsed_args.sign_key_path) < 1 + or len(parsed_args.sign_cert_id) < 1 ): msg = _( "'sign-key-path' and 'sign-cert-id' must both be " @@ -596,10 +596,7 @@ class CreateImage(command.ShowOne): ) kwargs = {} if volume_client.api_version < api_versions.APIVersion('3.1'): - if ( - parsed_args.visibility or - parsed_args.is_protected is not None - ): + if parsed_args.visibility or parsed_args.is_protected is not None: msg = _( '--os-volume-api-version 3.1 or greater is required ' 'to support the --public, --private, --community, ' @@ -618,7 +615,7 @@ class CreateImage(command.ShowOne): parsed_args.name, parsed_args.container_format, parsed_args.disk_format, - **kwargs + **kwargs, ) info = body['os-volume_upload_image'] try: @@ -659,7 +656,6 @@ class DeleteImage(command.Command): return parser def take_action(self, parsed_args): - del_result = 0 image_client = self.app.client_manager.image for image in parsed_args.images: diff --git a/openstackclient/image/v2/metadef_namespaces.py b/openstackclient/image/v2/metadef_namespaces.py index f09f2002..eaaae674 100644 --- a/openstackclient/image/v2/metadef_namespaces.py +++ b/openstackclient/image/v2/metadef_namespaces.py @@ -52,8 +52,9 @@ def _format_namespace(namespace): if key in fields_to_show: info[key] = namespace.get(key) elif key == "resource_type_associations": - info[key] = [resource_type['name'] - for resource_type in namespace.get(key)] + info[key] = [ + resource_type['name'] for resource_type in namespace.get(key) + ] elif key == 'properties': info['properties'] = list(namespace.get(key).keys()) @@ -114,11 +115,7 @@ class CreateMetadefNameSpace(command.ShowOne): def take_action(self, parsed_args): image_client = self.app.client_manager.image - filter_keys = [ - 'namespace', - 'display_name', - 'description' - ] + filter_keys = ['namespace', 'display_name', 'description'] kwargs = {} for key in filter_keys: @@ -160,15 +157,19 @@ class DeleteMetadefNameSpace(command.Command): image_client.delete_metadef_namespace(namespace.id) except Exception as e: result += 1 - LOG.error(_("Failed to delete namespace with name or " - "ID '%(namespace)s': %(e)s"), - {'namespace': i, 'e': e} - ) + LOG.error( + _( + "Failed to delete namespace with name or " + "ID '%(namespace)s': %(e)s" + ), + {'namespace': i, 'e': e}, + ) if result > 0: total = len(parsed_args.namespace_name) - msg = (_("%(result)s of %(total)s namespace failed " - "to delete.") % {'result': result, 'total': total}) + msg = _( + "%(result)s of %(total)s namespace failed " "to delete." + ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -203,11 +204,14 @@ class ListMetadefNameSpaces(command.Lister): column_headers = columns return ( column_headers, - (utils.get_item_properties( - s, - columns, - formatters=_formatters, - ) for s in data) + ( + utils.get_item_properties( + s, + columns, + formatters=_formatters, + ) + for s in data + ), ) @@ -268,11 +272,7 @@ class SetMetadefNameSpace(command.Command): namespace = parsed_args.namespace - filter_keys = [ - 'namespace', - 'display_name', - 'description' - ] + filter_keys = ['namespace', 'display_name', 'description'] kwargs = {} for key in filter_keys: |
