diff options
author | Stephen Finucane <sfinucan@redhat.com> | 2023-05-08 11:32:01 +0100 |
---|---|---|
committer | Stephen Finucane <sfinucan@redhat.com> | 2023-05-10 10:51:30 +0100 |
commit | aed521d426f45b335e1c69d8b2f6d103c916f75c (patch) | |
tree | 39eca8c658a0339cfbbe3b0e9e69232037be17f6 /openstackclient/identity/v3/mapping.py | |
parent | 6475dc58e8baa199d948c4b2d250c1fb45e0bd30 (diff) | |
download | python-openstackclient-aed521d426f45b335e1c69d8b2f6d103c916f75c.tar.gz |
Blacken openstackclient.identity
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: I2eeade1ce6653be8e9179ecc40105182c5ff5f16
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/identity/v3/mapping.py')
-rw-r--r-- | openstackclient/identity/v3/mapping.py | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/openstackclient/identity/v3/mapping.py b/openstackclient/identity/v3/mapping.py index 7d40a2b7..0a5925de 100644 --- a/openstackclient/identity/v3/mapping.py +++ b/openstackclient/identity/v3/mapping.py @@ -73,8 +73,10 @@ class _RulesReader(object): try: rules = json.loads(blob) except ValueError as e: - msg = _("An error occurred when reading rules from file " - "%(path)s: %(error)s") % {"path": path, "error": e} + msg = _( + "An error occurred when reading rules from file " + "%(path)s: %(error)s" + ) % {"path": path, "error": e} raise exceptions.CommandError(msg) else: return rules @@ -92,7 +94,8 @@ class CreateMapping(command.ShowOne, _RulesReader): ) parser.add_argument( '--rules', - metavar='<filename>', required=True, + metavar='<filename>', + required=True, help=_('Filename that contains a set of mapping rules (required)'), ) return parser @@ -102,8 +105,8 @@ class CreateMapping(command.ShowOne, _RulesReader): rules = self._read_rules(parsed_args.rules) mapping = identity_client.federation.mappings.create( - mapping_id=parsed_args.mapping, - rules=rules) + mapping_id=parsed_args.mapping, rules=rules + ) mapping._info.pop('links', None) return zip(*sorted(mapping._info.items())) @@ -130,13 +133,19 @@ class DeleteMapping(command.Command): identity_client.federation.mappings.delete(i) except Exception as e: result += 1 - LOG.error(_("Failed to delete mapping with name or " - "ID '%(mapping)s': %(e)s"), {'mapping': i, 'e': e}) + LOG.error( + _( + "Failed to delete mapping with name or " + "ID '%(mapping)s': %(e)s" + ), + {'mapping': i, 'e': e}, + ) if result > 0: total = len(parsed_args.mapping) - msg = (_("%(result)s of %(total)s mappings failed " - "to delete.") % {'result': result, 'total': total}) + msg = _( + "%(result)s of %(total)s mappings failed " "to delete." + ) % {'result': result, 'total': total} raise exceptions.CommandError(msg) @@ -177,8 +186,8 @@ class SetMapping(command.Command, _RulesReader): rules = self._read_rules(parsed_args.rules) mapping = identity_client.federation.mappings.update( - mapping=parsed_args.mapping, - rules=rules) + mapping=parsed_args.mapping, rules=rules + ) mapping._info.pop('links', None) |