Skip to content

Commit

Permalink
correcting "logical operation" to determine the boolean value.
Browse files Browse the repository at this point in the history
This code corrects the logical operation to determine the boolean
value, here it set to "False" when given value not in 0-255 range.

Signed-off-by: Shaik Abdulla <[email protected]>
  • Loading branch information
FarooqAbdulla01 committed May 8, 2023
1 parent 2f8775a commit 3530128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion avocado/utils/network/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ def validate_ipv4_netmask_format(self, netmask):
return False
for octect in netmask_list:
num = int(octect)
if 0 <= num <= 255:
if not 0 <= num <= 255:
return False
octet_bin = [format(int(i), "08b") for i in netmask_list]
binary_netmask = ("").join(octet_bin)
Expand Down

0 comments on commit 3530128

Please sign in to comment.