Fix the bug while fetching interface mapping dict
Change-Id: Ib047c001aa8e757a1cdc660ed541725c6a0c9fc0
This commit is contained in:
parent
b38d42b7bf
commit
0ccb558524
@ -377,14 +377,16 @@ class Network(object):
|
|||||||
hostname = agent['host']
|
hostname = agent['host']
|
||||||
if 'Linux bridge' in agent_type:
|
if 'Linux bridge' in agent_type:
|
||||||
agent_detail = self.neutron_client.show_agent(agent['id'])['agent']
|
agent_detail = self.neutron_client.show_agent(agent['id'])['agent']
|
||||||
ifname = agent_detail['configurations']['interface_mappings']['physnet1']
|
if 'physnet1' in agent_detail['configurations']['interface_mappings']:
|
||||||
internal_iface_dict[hostname] = ifname
|
ifname = agent_detail['configurations']['interface_mappings']['physnet1']
|
||||||
|
internal_iface_dict[hostname] = ifname
|
||||||
elif 'Open vSwitch' in agent_type:
|
elif 'Open vSwitch' in agent_type:
|
||||||
network_type = self.vm_int_net[0]['provider:network_type']
|
network_type = self.vm_int_net[0]['provider:network_type']
|
||||||
agent_detail = self.neutron_client.show_agent(agent['id'])['agent']
|
agent_detail = self.neutron_client.show_agent(agent['id'])['agent']
|
||||||
if network_type == "vlan":
|
if network_type == "vlan":
|
||||||
brname = agent_detail['configurations']['bridge_mappings']['physnet1']
|
if 'physnet1' in agent_detail['configurations']['bridge_mappings']:
|
||||||
internal_iface_dict[hostname] = brname
|
brname = agent_detail['configurations']['bridge_mappings']['physnet1']
|
||||||
|
internal_iface_dict[hostname] = brname
|
||||||
elif network_type == "vxlan" or network_type == 'gre':
|
elif network_type == "vxlan" or network_type == 'gre':
|
||||||
ipaddr = agent_detail['configurations']['tunneling_ip']
|
ipaddr = agent_detail['configurations']['tunneling_ip']
|
||||||
internal_iface_dict[hostname] = ipaddr
|
internal_iface_dict[hostname] = ipaddr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user