noauth: only set token_info if set

Only add the token_info to the keystone headers if it is set.
This resolves an issue which breaks the catalog for some previous
deployments using noauth middleware (the old TripleO undercloud
deploy architecture).

Change-Id: I74d0f71149014418db3af226b419eb7a9cb5bb1e
Closes-bug: #1730280
This commit is contained in:
Dan Prince 2017-11-06 16:40:13 +11:00
parent 86fcc11b80
commit b053c4586e
1 changed files with 2 additions and 1 deletions

View File

@ -66,8 +66,9 @@ class NoAuthProtocol(object):
'HTTP_X_AUTH_USER': username,
'HTTP_X_AUTH_KEY': 'unset',
'HTTP_X_AUTH_URL': 'url',
'keystone.token_info': self._token_info,
}
if self._token_info:
headers['keystone.token_info'] = self._token_info
return headers