Enable check for E129
E129 visually indented line with same indent as next logical line Change-Id: I438bf0d9de7f61ab65e753169c9a8007e84b215a
This commit is contained in:
parent
ae6c39397e
commit
3065afd6c0
@ -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)
|
||||
|
@ -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]):
|
||||
|
@ -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([
|
||||
|
@ -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."))
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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."))
|
||||
|
@ -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'])
|
||||
|
||||
|
2
tox.ini
2
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user