Commit a9fe7e8f authored by Guido Trotter's avatar Guido Trotter
Browse files

Iallocator: NIC parameters


Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 503b97a9
...@@ -6931,8 +6931,19 @@ class IAllocator(object): ...@@ -6931,8 +6931,19 @@ class IAllocator(object):
# instance data # instance data
instance_data = {} instance_data = {}
for iinfo, beinfo in i_list: for iinfo, beinfo in i_list:
nic_data = [{"mac": n.mac, "ip": n.ip, "bridge": n.bridge} nic_data = []
for n in iinfo.nics] for nic in iinfo.nics:
filled_params = objects.FillDict(
cluster_info.nicparams[constants.PP_DEFAULT],
nic.nicparams)
nic_dict = {"mac": nic.mac,
"ip": nic.ip,
"mode": filled_params[constants.NIC_MODE],
"link": filled_params[constants.NIC_LINK],
}
if filled_params[constants.NIC_MODE] == constants.NIC_MODE_BRIDGED:
nic_dict["bridge"] = filled_params[constants.NIC_LINK]
nic_data.append(nic_dict)
pir = { pir = {
"tags": list(iinfo.GetTags()), "tags": list(iinfo.GetTags()),
"admin_up": iinfo.admin_up, "admin_up": iinfo.admin_up,
......
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