Skip to content

Commit 8936dcf

Browse files
committed
Add host_ip interface
1 parent 14571f1 commit 8936dcf

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

module/sources/openstack/connection.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,12 +1007,25 @@ def add_host(self, obj):
10071007
if len(host_tags) > 0:
10081008
host_data["tags"] = host_tags
10091009

1010+
pnic_data_dict = dict()
1011+
pnic_data = {
1012+
"name": "eth0",
1013+
"device": None,
1014+
"enabled": True,
1015+
"type": "10gbase-t"
1016+
}
1017+
pnic_data_dict["eth0"] = pnic_data
1018+
1019+
vnic_ips = dict()
1020+
vnic_ips["eth0"] = list()
1021+
vnic_ips["eth0"].append(obj.host_ip)
1022+
10101023
host_primary_ip4 = obj.host_ip
10111024
host_primary_ip6 = None
10121025

10131026
# add host to inventory
1014-
self.add_device_vm_to_inventory(NBDevice, object_data=host_data, pnic_data=dict(),
1015-
vnic_data=dict(), nic_ips=None,
1027+
self.add_device_vm_to_inventory(NBDevice, object_data=host_data, pnic_data=pnic_data_dict,
1028+
vnic_data=dict(), nic_ips=vnic_ips,
10161029
p_ipv4=host_primary_ip4, p_ipv6=host_primary_ip6)
10171030

10181031
return

0 commit comments

Comments
 (0)