[apic_mapping] cast nat_epg_tenant to string before RPC answer

Closes-Bug #1626770

Change-Id: If0e0077f1e23c1cb2dd8a3ff444d2f7c61e16946
This commit is contained in:
Ivar Lazzaro
2016-09-22 15:31:05 -07:00
parent b11f37f860
commit 07942ded69
2 changed files with 11 additions and 1 deletions

View File

@@ -3793,7 +3793,7 @@ class ApicMappingDriver(api.ResourceMappingDriver,
self._tenant_uses_specific_nat_epg(context, es, tenant_obj)):
nat_epg_tenant = self.name_mapper.tenant(tenant_obj)
nat_epg_tenant = nat_epg_tenant or self._tenant_by_sharing_policy(es)
return nat_epg_tenant, nat_epg_name
return str(nat_epg_tenant), str(nat_epg_name)
def _tenant_uses_specific_nat_epg(self, context, es, tenant_obj):
session = context._plugin_context.session

View File

@@ -241,12 +241,22 @@ class ApicMappingTestCase(
self.driver.apic_manager.apic.fvTenant.name = echo2
self.driver.apic_manager.apic.fvCtx.name = echo2
self.real_get_gbp_details = self.driver.get_gbp_details
self.driver.get_gbp_details = self._get_gbp_details
self.driver.enable_metadata_opt = True
self.driver.enable_dhcp_opt = True
self._db_plugin = n_db.NeutronDbPluginV2()
def tearDown(self):
sys.modules["apicapi"] = self.saved_apicapi
super(ApicMappingTestCase, self).tearDown()
def _get_gbp_details(self, context, **kwargs):
details = self.real_get_gbp_details(context, **kwargs)
# Verify that the answer is serializable
details = jsonutils.loads(jsonutils.dumps(details))
return details
def _get_pts_addresses(self, pts):
addresses = []
for pt in pts: