Add admin tenant name to nova notifier

This change introduces the ability to use the nova admin
tenant name with the nova notifier in place of the nova
admin tenant id which may not be available when the neutron
service is being configured as is the case with tripleo
installations where the neutron service is configured and
started before the nova admin tenant has been configured in
keystone and thus does not have a known id.

DocImpact
Introduces the nova_admin_tenant_name configuration entry as
an optional configurable value in neutron.conf.  If the
nova_admin_tenant_name is configured and the nova_admin_tenanat_id
is not configured, a performance impact may be seen because
keystone will become involved in communication between neutron
and nova.

Change-Id: I33701d4dc9bf61595e44a49050c405ebca779091
Closes-Bug: #1331566
This commit is contained in:
Erik Colnick 2014-06-18 11:31:52 -06:00
parent dd238d0aac
commit cf92bbead9
3 changed files with 14 additions and 3 deletions

View File

@ -251,6 +251,11 @@ lock_path = $state_path/lock
# The uuid of the admin nova tenant
# nova_admin_tenant_id =
# The name of the admin nova tenant. If the uuid of the admin nova tenant
# is set, this is optional. Useful for cases where the uuid of the admin
# nova tenant is not available when configuration is being done.
# nova_admin_tenant_name =
# Password for connection to nova in admin context.
# nova_admin_password =

View File

@ -101,6 +101,8 @@ core_opts = [
secret=True),
cfg.StrOpt('nova_admin_tenant_id',
help=_('The uuid of the admin nova tenant')),
cfg.StrOpt('nova_admin_tenant_name',
help=_('The name of the admin nova tenant')),
cfg.StrOpt('nova_admin_auth_url',
default='http://localhost:5000/v2.0',
help=_('Authorization URL for connecting to nova in admin '

View File

@ -41,12 +41,16 @@ class Notifier(object):
def __init__(self):
# TODO(arosen): we need to cache the endpoints and figure out
# how to deal with different regions here....
bypass_url = "%s/%s" % (cfg.CONF.nova_url,
cfg.CONF.nova_admin_tenant_id)
if cfg.CONF.nova_admin_tenant_id:
bypass_url = "%s/%s" % (cfg.CONF.nova_url,
cfg.CONF.nova_admin_tenant_id)
else:
bypass_url = None
self.nclient = nclient.Client(
username=cfg.CONF.nova_admin_username,
api_key=cfg.CONF.nova_admin_password,
project_id=None,
project_id=cfg.CONF.nova_admin_tenant_name,
tenant_id=cfg.CONF.nova_admin_tenant_id,
auth_url=cfg.CONF.nova_admin_auth_url,
cacert=cfg.CONF.nova_ca_certificates_file,