Include credentials for heat calling self

When in standalone mode, heat needs to include heat credentials
when calling its own REST API.

This change assumes that heat is running in standalone mode if
heat.conf [clients_heat] url has been set.

Change-Id: I34e662c554ea66c6df6ebee6ce3bfb0dc3f8a948
Closes-Bug: #1302578
This commit is contained in:
Steve Baker 2014-09-23 11:59:12 +12:00
parent d9eebfdbc6
commit b61a45c13f
1 changed files with 8 additions and 0 deletions

View File

@ -34,6 +34,14 @@ class HeatClientPlugin(client_plugin.ClientPlugin):
}
endpoint = self.get_heat_url()
if self._get_client_option('heat', 'url'):
# assume that the heat API URL is manually configured because
# it is not in the keystone catalog, so include the credentials
# for the standalone auth_password middleware
args['username'] = self.context.username
args['password'] = self.context.password
del(args['token'])
return hc.Client('1', endpoint, **args)
def is_not_found(self, ex):