Use zone.tenant_id as tenant if context.project_id is None
When enable multi-tenant in infoblox integration, designate infoblox plugin need to get dns view. The input of this function is project_id in context. But when do periodic recovery job, the context is generated via init DesignateContext. We don't set project_id in it. So use zone.tenant_id instead on this situation. Closes-Bug: #1838379 Change-Id: I7e657d9fa4502621f48c6e40a7a2eb5e48a3ac3d
This commit is contained in:
parent
076f9fce0a
commit
1ac2c8db9a
|
@ -44,7 +44,8 @@ class InfobloxBackend(base.Backend):
|
||||||
def create_zone(self, context, zone):
|
def create_zone(self, context, zone):
|
||||||
LOG.info('Create Zone %r', zone)
|
LOG.info('Create Zone %r', zone)
|
||||||
|
|
||||||
dns_net_view = self.infoblox.get_dns_view(context.project_id)
|
project_id = context.project_id or zone.tenant_id
|
||||||
|
dns_net_view = self.infoblox.get_dns_view(project_id)
|
||||||
self.infoblox.create_zone_auth(
|
self.infoblox.create_zone_auth(
|
||||||
fqdn=zone['name'][0:-1],
|
fqdn=zone['name'][0:-1],
|
||||||
dns_view=dns_net_view
|
dns_view=dns_net_view
|
||||||
|
|
Loading…
Reference in New Issue