summaryrefslogtreecommitdiff
path: root/ironic/dhcp
diff options
context:
space:
mode:
authorSam Betts <sam@code-smash.net>2015-12-10 13:18:21 +0000
committerSam Betts <sam@code-smash.net>2015-12-10 13:18:21 +0000
commit66cf3d00cbac0bb00aad46d64ec8629b4051fd7a (patch)
treeb675e242fe52bb111fbd46c9bd0472c4e4931dab /ironic/dhcp
parent7b13f3b0a6dce57de61d23a5130835570da6658b (diff)
downloadironic-66cf3d00cbac0bb00aad46d64ec8629b4051fd7a.tar.gz
Always pass keystone credentials to neutronclient
If the token that is passed to the neutronclient has expired then the neutronclient will attempt to re-authenticate, when this happens the current implementation fails because it does not have the required credentials, this patch changes the _build_client code to pass the credentials and token to neutronclient and let it decide which to use. Change-Id: Icf426a269a41fc941cf95f9c7f279a468dad2400 Closes-Bug: #1524779
Diffstat (limited to 'ironic/dhcp')
-rw-r--r--ironic/dhcp/neutron.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/ironic/dhcp/neutron.py b/ironic/dhcp/neutron.py
index c6ffb8f96..8548c1b4c 100644
--- a/ironic/dhcp/neutron.py
+++ b/ironic/dhcp/neutron.py
@@ -77,8 +77,7 @@ def _build_client(token=None):
if CONF.neutron.auth_strategy == 'noauth':
params['endpoint_url'] = CONF.neutron.url
params['auth_strategy'] = 'noauth'
- elif (CONF.neutron.auth_strategy == 'keystone' and
- token is None):
+ else:
params['endpoint_url'] = (CONF.neutron.url or
keystone.get_service_url('neutron'))
params['username'] = CONF.keystone_authtoken.admin_user
@@ -87,10 +86,7 @@ def _build_client(token=None):
params['auth_url'] = (CONF.keystone_authtoken.auth_uri or '')
if CONF.keystone.region_name:
params['region_name'] = CONF.keystone.region_name
- else:
params['token'] = token
- params['endpoint_url'] = CONF.neutron.url
- params['auth_strategy'] = None
return clientv20.Client(**params)