fixed the domain using default value.
The value of domain is hard code. Due to the different Openstack installation configuration, the values in the configuration file should be used. Change-Id: Idab8f590aa98a1f943474e2c4c9e68ca4e3d1837
This commit is contained in:
parent
92ee4eddcd
commit
3c78af7d86
@ -29,6 +29,10 @@ OPTS = [
|
|||||||
help=_('Password for alarm monitoring')),
|
help=_('Password for alarm monitoring')),
|
||||||
cfg.StrOpt('project_name', default='admin',
|
cfg.StrOpt('project_name', default='admin',
|
||||||
help=_('Project name for alarm monitoring')),
|
help=_('Project name for alarm monitoring')),
|
||||||
|
cfg.StrOpt('user_domain_name', default='default',
|
||||||
|
help=_('User domain name for alarm monitoring')),
|
||||||
|
cfg.StrOpt('project_domain_name', default='default',
|
||||||
|
help=_('Project domain name for alarm monitoring')),
|
||||||
]
|
]
|
||||||
|
|
||||||
cfg.CONF.register_opts(OPTS, 'alarm_auth')
|
cfg.CONF.register_opts(OPTS, 'alarm_auth')
|
||||||
@ -48,12 +52,13 @@ class AlarmReceiver(wsgi.Middleware):
|
|||||||
return
|
return
|
||||||
prefix, info, params = self.handle_url(req.url)
|
prefix, info, params = self.handle_url(req.url)
|
||||||
auth = cfg.CONF.keystone_authtoken
|
auth = cfg.CONF.keystone_authtoken
|
||||||
token = Token(username=cfg.CONF.alarm_auth.username,
|
alarm_auth = cfg.CONF.alarm_auth
|
||||||
password=cfg.CONF.alarm_auth.password,
|
token = Token(username=alarm_auth.username,
|
||||||
project_name=cfg.CONF.alarm_auth.project_name,
|
password=alarm_auth.password,
|
||||||
|
project_name=alarm_auth.project_name,
|
||||||
auth_url=auth.auth_url + '/v3',
|
auth_url=auth.auth_url + '/v3',
|
||||||
user_domain_name='default',
|
user_domain_name=alarm_auth.user_domain_name,
|
||||||
project_domain_name='default')
|
project_domain_name=alarm_auth.project_domain_name)
|
||||||
|
|
||||||
token_identity = token.create_token()
|
token_identity = token.create_token()
|
||||||
req.headers['X_AUTH_TOKEN'] = token_identity
|
req.headers['X_AUTH_TOKEN'] = token_identity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user