diff --git a/.pylintrc b/.pylintrc index 79607cf62fa..13b15540751 100644 --- a/.pylintrc +++ b/.pylintrc @@ -87,7 +87,6 @@ disable= too-many-return-statements, too-many-statements, # new for python3 version of pylint - chained-comparison, consider-using-dict-comprehension, consider-using-set-comprehension, unnecessary-pass, diff --git a/neutron/extensions/securitygroup.py b/neutron/extensions/securitygroup.py index 6e72f2e0595..5c905ff52ac 100644 --- a/neutron/extensions/securitygroup.py +++ b/neutron/extensions/securitygroup.py @@ -153,7 +153,7 @@ def convert_protocol(value): return try: val = int(value) - if val >= 0 and val <= 255: + if 0 <= val <= 255: # Set value of protocol number to string due to bug 1381379, # PostgreSQL fails when it tries to compare integer with string, # that exists in db. diff --git a/neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py b/neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py index 51866e4b00c..6c020bffe46 100644 --- a/neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py +++ b/neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py @@ -192,7 +192,7 @@ class EmbSwitch(object): # convert the rate_kbps value from kbps to Mbps. # Zero means to disable the rate so the lowest rate available is 1Mbps. # Floating numbers are not allowed - if rate_kbps > 0 and rate_kbps < 1000: + if 0 < rate_kbps < 1000: rate_mbps = 1 else: rate_mbps = helpers.round_val(rate_kbps / 1000.0)