Merge "Enable Keystone v3 endpoints for Inspector"
This commit is contained in:
commit
ade97c9700
@ -162,7 +162,7 @@ function configure_inspector {
|
|||||||
|
|
||||||
cp "$IRONIC_INSPECTOR_DIR/example.conf" "$IRONIC_INSPECTOR_CONF_FILE"
|
cp "$IRONIC_INSPECTOR_DIR/example.conf" "$IRONIC_INSPECTOR_CONF_FILE"
|
||||||
inspector_iniset DEFAULT debug $IRONIC_INSPECTOR_DEBUG
|
inspector_iniset DEFAULT debug $IRONIC_INSPECTOR_DEBUG
|
||||||
inspector_iniset ironic os_auth_url "$KEYSTONE_SERVICE_URI/v2.0"
|
inspector_iniset ironic os_auth_url "$KEYSTONE_SERVICE_URI"
|
||||||
inspector_iniset ironic os_username $IRONIC_INSPECTOR_ADMIN_USER
|
inspector_iniset ironic os_username $IRONIC_INSPECTOR_ADMIN_USER
|
||||||
inspector_iniset ironic os_password $SERVICE_PASSWORD
|
inspector_iniset ironic os_password $SERVICE_PASSWORD
|
||||||
inspector_iniset ironic os_tenant_name $SERVICE_TENANT_NAME
|
inspector_iniset ironic os_tenant_name $SERVICE_TENANT_NAME
|
||||||
|
@ -15,7 +15,7 @@ import socket
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from ironicclient import client
|
from ironicclient import client
|
||||||
import keystoneclient.v2_0.client as keystone_client
|
from keystoneclient import client as keystone_client
|
||||||
from keystonemiddleware import auth_token
|
from keystonemiddleware import auth_token
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ class TestCheckAuth(base.BaseTest):
|
|||||||
CONF.set_override('admin_user', 'admin', 'keystone_authtoken')
|
CONF.set_override('admin_user', 'admin', 'keystone_authtoken')
|
||||||
CONF.set_override('admin_tenant_name', 'admin', 'keystone_authtoken')
|
CONF.set_override('admin_tenant_name', 'admin', 'keystone_authtoken')
|
||||||
CONF.set_override('admin_password', 'password', 'keystone_authtoken')
|
CONF.set_override('admin_password', 'password', 'keystone_authtoken')
|
||||||
CONF.set_override('auth_uri', 'http://127.0.0.1:5000/v2.0',
|
CONF.set_override('auth_uri', 'http://127.0.0.1:5000',
|
||||||
'keystone_authtoken')
|
'keystone_authtoken')
|
||||||
CONF.set_override('identity_uri', 'http://127.0.0.1:35357',
|
CONF.set_override('identity_uri', 'http://127.0.0.1:35357',
|
||||||
'keystone_authtoken')
|
'keystone_authtoken')
|
||||||
@ -87,7 +87,7 @@ class TestCheckAuth(base.BaseTest):
|
|||||||
self.assertEqual('admin', args1['admin_tenant_name'])
|
self.assertEqual('admin', args1['admin_tenant_name'])
|
||||||
self.assertEqual('password', args1['admin_password'])
|
self.assertEqual('password', args1['admin_password'])
|
||||||
self.assertTrue(args1['delay_auth_decision'])
|
self.assertTrue(args1['delay_auth_decision'])
|
||||||
self.assertEqual('http://127.0.0.1:5000/v2.0', args1['auth_uri'])
|
self.assertEqual('http://127.0.0.1:5000', args1['auth_uri'])
|
||||||
self.assertEqual('http://127.0.0.1:35357', args1['identity_uri'])
|
self.assertEqual('http://127.0.0.1:35357', args1['identity_uri'])
|
||||||
|
|
||||||
@mock.patch.object(auth_token, 'AuthProtocol')
|
@mock.patch.object(auth_token, 'AuthProtocol')
|
||||||
|
@ -17,7 +17,7 @@ import socket
|
|||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
from ironicclient import client
|
from ironicclient import client
|
||||||
import keystoneclient.v2_0.client as keystone_client
|
from keystoneclient import client as keystone_client
|
||||||
from keystonemiddleware import auth_token
|
from keystonemiddleware import auth_token
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
@ -170,6 +170,9 @@ def get_client(token=None,
|
|||||||
'auth_url': CONF.ironic.os_auth_url,
|
'auth_url': CONF.ironic.os_auth_url,
|
||||||
'tenant_name': CONF.ironic.os_tenant_name}
|
'tenant_name': CONF.ironic.os_tenant_name}
|
||||||
keystone = keystone_client.Client(**keystone_creds)
|
keystone = keystone_client.Client(**keystone_creds)
|
||||||
|
# FIXME(sambetts): Work around for Bug 1539839 as client.authenticate
|
||||||
|
# is not called.
|
||||||
|
keystone.authenticate()
|
||||||
ironic_url = keystone.service_catalog.url_for(
|
ironic_url = keystone.service_catalog.url_for(
|
||||||
service_type=CONF.ironic.os_service_type,
|
service_type=CONF.ironic.os_service_type,
|
||||||
endpoint_type=CONF.ironic.os_endpoint_type)
|
endpoint_type=CONF.ironic.os_endpoint_type)
|
||||||
|
Loading…
Reference in New Issue
Block a user