Merge "Enable session based authentication used by sushy"
This commit is contained in:
commit
28291c6647
|
@ -18,7 +18,6 @@ import json
|
|||
|
||||
from six.moves.urllib import parse
|
||||
import sushy
|
||||
from sushy import auth
|
||||
from sushy.resources.system import mappings as sushy_map
|
||||
from sushy import utils
|
||||
|
||||
|
@ -153,10 +152,9 @@ class RedfishOperations(operations.IloOperations):
|
|||
self._username = username
|
||||
|
||||
try:
|
||||
basic_auth = auth.BasicAuth(username=username, password=password)
|
||||
self._sushy = main.HPESushy(
|
||||
address, root_prefix=root_prefix, verify=verify,
|
||||
auth=basic_auth)
|
||||
address, username=username, password=password,
|
||||
root_prefix=root_prefix, verify=verify)
|
||||
except sushy.exceptions.SushyError as e:
|
||||
msg = (self._('The Redfish controller at "%(controller)s" has '
|
||||
'thrown error. Error %(error)s') %
|
||||
|
|
|
@ -21,7 +21,6 @@ import mock
|
|||
import sushy
|
||||
import testtools
|
||||
|
||||
from sushy import auth
|
||||
from sushy.resources.system import system
|
||||
|
||||
from proliantutils import exception
|
||||
|
@ -65,7 +64,8 @@ class RedfishOperationsTestCase(testtools.TestCase):
|
|||
self.assertEqual(('https://1.2.3.4',), args)
|
||||
self.assertFalse(kwargs.get('verify'))
|
||||
self.assertEqual('/redfish/v1/', kwargs.get('root_prefix'))
|
||||
self.assertIsInstance(kwargs.get('auth'), auth.BasicAuth)
|
||||
self.assertEqual('foo', kwargs.get('username'))
|
||||
self.assertEqual('bar', kwargs.get('password'))
|
||||
|
||||
@mock.patch.object(main, 'HPESushy', autospec=True)
|
||||
def test_sushy_init_fail(self, sushy_mock):
|
||||
|
|
Loading…
Reference in New Issue