diff --git a/novaclient/client.py b/novaclient/client.py index de4fb3772..eec9a8e57 100644 --- a/novaclient/client.py +++ b/novaclient/client.py @@ -421,7 +421,7 @@ class HTTPClient(object): # or 'actively refused' in the body, so that's what we'll do. if resp.status_code == 400: if ('Connection refused' in resp.text or - 'actively refused' in resp.text): + 'actively refused' in resp.text): raise exceptions.ConnectionRefused(resp.text) try: body = json.loads(resp.text) diff --git a/novaclient/shell.py b/novaclient/shell.py index 3c7950529..a4e2dfcc6 100644 --- a/novaclient/shell.py +++ b/novaclient/shell.py @@ -135,7 +135,7 @@ class SecretsHelper(object): if not HAS_KEYRING or not self.args.os_cache: return if (auth_token == self.auth_token and - management_url == self.management_url): + management_url == self.management_url): # Nothing changed.... return if not all([management_url, auth_token, tenant_id]): diff --git a/novaclient/tests/test_shell.py b/novaclient/tests/test_shell.py index 38e219f76..c2a484937 100644 --- a/novaclient/tests/test_shell.py +++ b/novaclient/tests/test_shell.py @@ -200,8 +200,8 @@ class ShellTest(utils.TestCase): # default output of empty tables differs depending between prettytable # versions if (hasattr(prettytable, '__version__') and - dist_version.StrictVersion(prettytable.__version__) < - dist_version.StrictVersion('0.7.2')): + dist_version.StrictVersion(prettytable.__version__) < + dist_version.StrictVersion('0.7.2')): ex = '\n' else: ex = '\n'.join([ diff --git a/novaclient/v1_1/servers.py b/novaclient/v1_1/servers.py index da0a74972..66db32deb 100644 --- a/novaclient/v1_1/servers.py +++ b/novaclient/v1_1/servers.py @@ -537,7 +537,7 @@ class ServerManager(base.BootingManagerWithFind): if nic_info.get('net-id'): net_data['uuid'] = nic_info['net-id'] if (nic_info.get('v4-fixed-ip') and - nic_info.get('v6-fixed-ip')): + nic_info.get('v6-fixed-ip')): raise base.exceptions.CommandError(_( "Only one of 'v4-fixed-ip' and 'v6-fixed-ip' may be" " provided.")) diff --git a/novaclient/v1_1/shell.py b/novaclient/v1_1/shell.py index 9daeb61c9..b36db0e44 100644 --- a/novaclient/v1_1/shell.py +++ b/novaclient/v1_1/shell.py @@ -156,7 +156,8 @@ def _boot(cs, args): max_count = 1 # Don't let user mix num_instances and max_count/min_count. if (args.num_instances is not None and - args.min_count is None and args.max_count is None): + args.min_count is None and + args.max_count is None): if args.num_instances < 1: raise exceptions.CommandError(_("num_instances should be >= 1")) max_count = args.num_instances @@ -173,10 +174,10 @@ def _boot(cs, args): if args.max_count < 1: raise exceptions.CommandError(_("max_count should be >= 1")) max_count = args.max_count - if (args.min_count is not None and args.max_count is not None and - args.min_count > args.max_count): - raise exceptions.CommandError(_( - "min_count should be <= max_count")) + if (args.min_count is not None and + args.max_count is not None and + args.min_count > args.max_count): + raise exceptions.CommandError(_("min_count should be <= max_count")) flavor = _find_flavor(cs, args.flavor) @@ -2435,10 +2436,10 @@ def do_secgroup_delete_rule(cs, args): secgroup = _get_secgroup(cs, args.secgroup) for rule in secgroup.rules: if (rule['ip_protocol'] and - rule['ip_protocol'].upper() == args.ip_proto.upper() and - rule['from_port'] == int(args.from_port) and - rule['to_port'] == int(args.to_port) and - rule['ip_range']['cidr'] == args.cidr): + rule['ip_protocol'].upper() == args.ip_proto.upper() and + rule['from_port'] == int(args.from_port) and + rule['to_port'] == int(args.to_port) and + rule['ip_range']['cidr'] == args.cidr): _print_secgroup_rules([rule]) return cs.security_group_rules.delete(rule['id']) @@ -3875,10 +3876,10 @@ def do_secgroup_delete_default_rule(cs, args): """Delete a rule from the default security group.""" for rule in cs.security_group_default_rules.list(): if (rule.ip_protocol and - rule.ip_protocol.upper() == args.ip_proto.upper() and - rule.from_port == int(args.from_port) and - rule.to_port == int(args.to_port) and - rule.ip_range['cidr'] == args.cidr): + rule.ip_protocol.upper() == args.ip_proto.upper() and + rule.from_port == int(args.from_port) and + rule.to_port == int(args.to_port) and + rule.ip_range['cidr'] == args.cidr): _print_secgroup_rules([rule], show_source_group=False) return cs.security_group_default_rules.delete(rule.id) diff --git a/novaclient/v3/servers.py b/novaclient/v3/servers.py index bd188804d..d25b6d84a 100644 --- a/novaclient/v3/servers.py +++ b/novaclient/v3/servers.py @@ -461,7 +461,7 @@ class ServerManager(base.BootingManagerWithFind): if nic_info.get('net-id'): net_data['uuid'] = nic_info['net-id'] if (nic_info.get('v4-fixed-ip') and - nic_info.get('v6-fixed-ip')): + nic_info.get('v6-fixed-ip')): raise base.exceptions.CommandError(_( "Only one of 'v4-fixed-ip' and 'v6-fixed-ip' may be" " provided.")) diff --git a/novaclient/v3/shell.py b/novaclient/v3/shell.py index d06f8d09b..3e67104fc 100644 --- a/novaclient/v3/shell.py +++ b/novaclient/v3/shell.py @@ -88,7 +88,8 @@ def _boot(cs, args): max_count = 1 # Don't let user mix num_instances and max_count/min_count. if (args.num_instances is not None and - args.min_count is None and args.max_count is None): + args.min_count is None and + args.max_count is None): if args.num_instances < 1: raise exceptions.CommandError("num_instances should be >= 1") max_count = args.num_instances @@ -105,10 +106,10 @@ def _boot(cs, args): if args.max_count < 1: raise exceptions.CommandError("max_count should be >= 1") max_count = args.max_count - if (args.min_count is not None and args.max_count is not None and - args.min_count > args.max_count): - raise exceptions.CommandError( - "min_count should be <= max_count") + if (args.min_count is not None and + args.max_count is not None and + args.min_count > args.max_count): + raise exceptions.CommandError("min_count should be <= max_count") flavor = _find_flavor(cs, args.flavor) @@ -1846,10 +1847,10 @@ def do_secgroup_delete_rule(cs, args): secgroup = _get_secgroup(cs, args.secgroup) for rule in secgroup.rules: if (rule['ip_protocol'] and - rule['ip_protocol'].upper() == args.ip_proto.upper() and - rule['from_port'] == int(args.from_port) and - rule['to_port'] == int(args.to_port) and - rule['ip_range']['cidr'] == args.cidr): + rule['ip_protocol'].upper() == args.ip_proto.upper() and + rule['from_port'] == int(args.from_port) and + rule['to_port'] == int(args.to_port) and + rule['ip_range']['cidr'] == args.cidr): _print_secgroup_rules([rule]) return cs.security_group_rules.delete(rule['id']) diff --git a/tox.ini b/tox.ini index 3afa423f3..47a36a4f3 100644 --- a/tox.ini +++ b/tox.ini @@ -42,7 +42,7 @@ downloadcache = ~/cache/pip # reason: removed in hacking (https://review.openstack.org/#/c/101701/) # # Additional checks are also ignored on purpose: F811, F821 -ignore = E124,E128,E129,F811,F821,H402,H404,H405,H904 +ignore = E124,E128,F811,F821,H402,H404,H405,H904 show-source = True exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,doc/source/conf.py