Commit 9eddb6e1 authored by Morten Knutsen's avatar Morten Knutsen

Use slow nested loop to get nics to ensure we get all of them.. The NIC...

Use slow nested loop to get nics to ensure we get all of them.. The NIC collection seems to be buggy as of now.
parent d5f4066c
......@@ -50,11 +50,13 @@ def main():
dns = dns_rr.client_from_conf(conf)
nics = set()
for nic in vmm_client.query_collection("VirtualNetworkAdapters"):
mac = nic.properties["MACAddress"]
vmnet = nic.properties["VMNetworkId"]
if mac is not None and (vmnet == uuid.UUID("5cc21a4c-a5b9-413d-b607-3ce7020c8b98") or vmnet is None):
nics.add(mac.lower())
for vm in vmm_client.query_collection("VirtualMachines"):
vm_nics = vm.get_resource("VirtualNetworkAdapters")
for nic in vm_nics:
mac = nic.properties["MACAddress"]
vmnet = nic.properties["VMNetworkId"]
if mac is not None and (vmnet == uuid.UUID("5cc21a4c-a5b9-413d-b607-3ce7020c8b98") or vmnet is None):
nics.add(mac.lower())
for entry in etcd_client.read("/nova/iaas/instances").children:
if not entry.dir:
next
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment