diff --git a/etc/neutron.conf b/etc/neutron.conf index 0836626424..1c7042a3f7 100644 --- a/etc/neutron.conf +++ b/etc/neutron.conf @@ -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 = diff --git a/neutron/common/config.py b/neutron/common/config.py index cda8d0503b..7f60851a60 100644 --- a/neutron/common/config.py +++ b/neutron/common/config.py @@ -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 ' diff --git a/neutron/notifiers/nova.py b/neutron/notifiers/nova.py index aa4f1b53e1..2b2bab63d1 100644 --- a/neutron/notifiers/nova.py +++ b/neutron/notifiers/nova.py @@ -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,