NSX|P: Fix router interface segment id

When setting a segment as a router interface, the plugin should
use the real segment id.
_get_network_nsx_id returns the realized id on the nsx manager which is wrong.

Change-Id: Id0e435cda0d43607f6000f14d8ac9621ec9d64e4
This commit is contained in:
Adit Sarfaty 2018-12-10 14:19:09 +02:00
parent 234cbbec23
commit 60ba0dd23b
1 changed files with 2 additions and 2 deletions

View File

@ -982,7 +982,7 @@ class NsxPolicyPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
net = self._get_network(context, network_id)
net_name = utils.get_name_and_uuid(
net['name'] or 'network', network_id)
segment_id = self._get_network_nsx_id(context, network_id)
segment_id = self._get_network_nsx_segment_id(context, network_id)
subnet = self.get_subnet(context, info['subnet_ids'][0])
pol_subnet = policy_defs.Subnet(
gateway_address=("%s/32" % subnet.get('gateway_ip')))
@ -1013,7 +1013,7 @@ class NsxPolicyPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
net = self._get_network(context, network_id)
net_name = utils.get_name_and_uuid(
net['name'] or 'network', network_id)
segment_id = self._get_network_nsx_id(context, network_id)
segment_id = self._get_network_nsx_segment_id(context, network_id)
self.nsxpolicy.segment.update(segment_id, name=net_name,
tier1_id=None)
except Exception as ex: