Skip to content

Commit dc8afd5

Browse files
fix : minor edit in set_ip function
1 parent ebb76c0 commit dc8afd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

orangetool/orangetool_ip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def set_ip(ip, restart=False, device="eth0", debug=False):
110110
dns-nameservers 8.8.8.8 8.8.4.4
111111
'''
112112
try:
113-
if bool(re.match(IP_PATTERN, ip)) == False or ip.find(
113+
if not bool(re.match(IP_PATTERN, ip)) or ip.find(
114114
"192.168.") == -1 or device not in mac().keys():
115115
raise Exception("IP Formation Error")
116116
static_string = static_string.replace("ip", ip)
@@ -142,7 +142,7 @@ def ping(ip, packet_number=3, debug=False):
142142
:return: a boolean value (True if ip is available and False otherwise)
143143
"""
144144
try:
145-
if re.match(IP_PATTERN, ip) == False:
145+
if not re.match(IP_PATTERN, ip):
146146
raise Exception("IP Formation Error")
147147
output = str(list(sub.Popen(["ping",
148148
ip,

0 commit comments

Comments
 (0)