|
|
@ -94,7 +94,7 @@ def get_networks(session):
|
|
|
|
recs = session.xenapi.network.get_all_records()
|
|
|
|
recs = session.xenapi.network.get_all_records()
|
|
|
|
xs_networks = {}
|
|
|
|
xs_networks = {}
|
|
|
|
networks = change_keys(recs, key='uuid')
|
|
|
|
networks = change_keys(recs, key='uuid')
|
|
|
|
for network in networks.itervalues():
|
|
|
|
for network in networks.values():
|
|
|
|
xs_networks[network['name_label']] = network
|
|
|
|
xs_networks[network['name_label']] = network
|
|
|
|
return xs_networks
|
|
|
|
return xs_networks
|
|
|
|
|
|
|
|
|
|
|
@ -104,7 +104,7 @@ def get_pifs(session):
|
|
|
|
pifs = change_keys(recs, key='uuid')
|
|
|
|
pifs = change_keys(recs, key='uuid')
|
|
|
|
xs_pifs = {}
|
|
|
|
xs_pifs = {}
|
|
|
|
devicenums = range(0, 7)
|
|
|
|
devicenums = range(0, 7)
|
|
|
|
for pif in pifs.itervalues():
|
|
|
|
for pif in pifs.values():
|
|
|
|
for eth in devicenums:
|
|
|
|
for eth in devicenums:
|
|
|
|
interface_name = "eth%s" % (eth)
|
|
|
|
interface_name = "eth%s" % (eth)
|
|
|
|
bond_name = interface_name.replace('eth', 'bond')
|
|
|
|
bond_name = interface_name.replace('eth', 'bond')
|
|
|
@ -151,7 +151,7 @@ def get_vms(session):
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
vms = change_keys(recs, key='uuid')
|
|
|
|
vms = change_keys(recs, key='uuid')
|
|
|
|
for vm in vms.itervalues():
|
|
|
|
for vm in vms.values():
|
|
|
|
xs_vms[vm['name_label']] = vm
|
|
|
|
xs_vms[vm['name_label']] = vm
|
|
|
|
return xs_vms
|
|
|
|
return xs_vms
|
|
|
|
|
|
|
|
|
|
|
@ -162,7 +162,7 @@ def get_srs(session):
|
|
|
|
if not recs:
|
|
|
|
if not recs:
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
srs = change_keys(recs, key='uuid')
|
|
|
|
srs = change_keys(recs, key='uuid')
|
|
|
|
for sr in srs.itervalues():
|
|
|
|
for sr in srs.values():
|
|
|
|
xs_srs[sr['name_label']] = sr
|
|
|
|
xs_srs[sr['name_label']] = sr
|
|
|
|
return xs_srs
|
|
|
|
return xs_srs
|
|
|
|
|
|
|
|
|
|
|
|