Merge "Fix NoSuchOptError when referring to conf.neutron.auth_plugin"
This commit is contained in:
commit
9a2a629cda
@ -104,7 +104,7 @@ def _load_auth_plugin(conf):
|
|||||||
if auth_plugin:
|
if auth_plugin:
|
||||||
return auth_plugin
|
return auth_plugin
|
||||||
|
|
||||||
err_msg = _('Unknown auth plugin: %s') % conf.neutron.auth_plugin
|
err_msg = _('Unknown auth type: %s') % conf.neutron.auth_type
|
||||||
raise neutron_client_exc.Unauthorized(message=err_msg)
|
raise neutron_client_exc.Unauthorized(message=err_msg)
|
||||||
|
|
||||||
|
|
||||||
|
@ -181,6 +181,13 @@ class TestNeutronClient(test.NoDBTestCase):
|
|||||||
client1.list_networks(retrieve_all=False)
|
client1.list_networks(retrieve_all=False)
|
||||||
self.assertEqual('new_token2', client1.httpclient.auth.get_token(None))
|
self.assertEqual('new_token2', client1.httpclient.auth.get_token(None))
|
||||||
|
|
||||||
|
@mock.patch.object(ks_loading, 'load_auth_from_conf_options')
|
||||||
|
def test_load_auth_plugin_failed(self, mock_load_from_conf):
|
||||||
|
mock_load_from_conf.return_value = None
|
||||||
|
from neutronclient.common import exceptions as neutron_client_exc
|
||||||
|
self.assertRaises(neutron_client_exc.Unauthorized,
|
||||||
|
neutronapi._load_auth_plugin, CONF)
|
||||||
|
|
||||||
|
|
||||||
class TestNeutronv2Base(test.TestCase):
|
class TestNeutronv2Base(test.TestCase):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user