Merge "Fixes session issue for Gen10 servers"

This commit is contained in:
Zuul 2018-04-17 11:16:09 +00:00 committed by Gerrit Code Review
commit fd12088a11
4 changed files with 13 additions and 8 deletions

View File

@ -18,6 +18,7 @@ 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
@ -141,9 +142,10 @@ class RedfishOperations(operations.IloOperations):
self._username = username
try:
basic_auth = auth.BasicAuth(username=username, password=password)
self._sushy = main.HPESushy(
address, username=username, password=password,
root_prefix=root_prefix, verify=verify)
address, root_prefix=root_prefix, verify=verify,
auth=basic_auth)
except sushy.exceptions.SushyError as e:
msg = (self._('The Redfish controller at "%(controller)s" has '
'thrown error. Error %(error)s') %

View File

@ -40,8 +40,6 @@ class HPEUpdateServiceTestCase(testtools.TestCase):
self.rf_client = redfish.RedfishOperations(
'1.2.3.4', username='foo', password='bar')
sushy_mock.assert_called_once_with(
'https://1.2.3.4', 'foo', 'bar', '/redfish/v1/', False)
self.us_inst = update_service.HPEUpdateService(
self.conn, '/redfish/v1/UpdateService/1',
redfish_version='1.0.2')

View File

@ -21,6 +21,9 @@ import mock
import sushy
import testtools
from sushy import auth
from sushy.resources.system import system
from proliantutils import exception
from proliantutils.ilo import constants as ilo_cons
from proliantutils.redfish import main
@ -38,7 +41,6 @@ from proliantutils.redfish.resources.system.storage import array_controller
from proliantutils.redfish.resources.system.storage \
import common as common_storage
from proliantutils.redfish.resources.system import system as pro_sys
from sushy.resources.system import system
@ddt.ddt
@ -59,8 +61,11 @@ class RedfishOperationsTestCase(testtools.TestCase):
self.rf_client = redfish.RedfishOperations(
'1.2.3.4', username='foo', password='bar')
sushy_mock.assert_called_once_with(
'https://1.2.3.4', 'foo', 'bar', '/redfish/v1/', False)
args, kwargs = sushy_mock.call_args
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)
@mock.patch.object(main, 'HPESushy', autospec=True)
def test_sushy_init_fail(self, sushy_mock):

View File

@ -9,4 +9,4 @@ retrying!=1.3.0,>=1.2.3 # Apache-2.0
pysnmp>=4.2.3,<5.0.0 # BSD
# Redfish communication uses the Sushy library
sushy
sushy>=1.3.1