Fixes issue in get_dhcp_hosts_in_use

The method must not return a tuple if the DHCP server is not available.
This commit is contained in:
Alessandro Pilotti 2014-07-26 00:59:13 +03:00
parent c1e004ed2f
commit 50cd373401

View File

@ -467,7 +467,7 @@ class WindowsUtils(base.BaseOSUtils):
def get_dhcp_hosts_in_use(self):
dhcp_hosts = []
for net_addr in network.get_adapter_addresses():
if net_addr["dhcp_enabled"]:
if net_addr["dhcp_enabled"] and net_addr["dhcp_server"]:
dhcp_hosts.append((net_addr["mac_address"],
net_addr["dhcp_server"]))
return dhcp_hosts