Fix pylint R1716 (chained-comparison) refactor messages

Use "a < b < c" instead of "a < b and b < c".

Change-Id: I1f0c46a609c56ffe869486b25fe6e82faaf3d5fb
This commit is contained in:
Brian Haley 2019-02-20 12:01:37 -05:00
parent fba5eb694b
commit 7b973d151e
3 changed files with 2 additions and 3 deletions

View File

@ -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,

View File

@ -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.

View File

@ -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)