Make better error when we have no netmask

Fix #1541
This commit is contained in:
Julien Duponchelle committed 2016-09-27 11:47:18 +02:00
1 parent 5555662b2c
commit 3ea5df7462
3 files changed
+29 -1

No files matched your search

+16
View File
@@ -111,6 +111,22 @@ def get_windows_interfaces():
return interfaces
def has_netmask(interface_name):
"""
Checks if an interface has a netmask.
:param interface: interface name
:returns: boolean
"""
for interface in interfaces():
if interface["name"] == interface_name:
if interface["netmask"] and len(interface["netmask"]) > 0:
return True
return False
return False
def is_interface_up(interface):
"""
Checks if an interface is up.