Merge "Revert "Raise an AccessError with SessionService init""
This commit is contained in:
commit
a98df1c8b3
@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
fixes:
|
|
||||||
- |
|
|
||||||
Fixes an issue where stale or invalid authentication data may
|
|
||||||
result in an attempt to lookup the ``SessionService`` failing
|
|
||||||
without any exception. The failure will now raise an
|
|
||||||
``AccessError`` exception.
|
|
@ -54,7 +54,6 @@ class SessionService(base.ResourceBase):
|
|||||||
:param registries: Dict of Redfish Message Registry objects to be
|
:param registries: Dict of Redfish Message Registry objects to be
|
||||||
used in any resource that needs registries to parse messages
|
used in any resource that needs registries to parse messages
|
||||||
:param root: Sushy root object. Empty for Sushy root itself.
|
:param root: Sushy root object. Empty for Sushy root itself.
|
||||||
:raises: AccessError if resource authentication fails.
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
super(SessionService, self).__init__(
|
super(SessionService, self).__init__(
|
||||||
@ -66,7 +65,6 @@ class SessionService(base.ResourceBase):
|
|||||||
'SessionService. If this happens before '
|
'SessionService. If this happens before '
|
||||||
'authentication, we\'ll have to guess the Sessions URL.',
|
'authentication, we\'ll have to guess the Sessions URL.',
|
||||||
ae)
|
ae)
|
||||||
raise
|
|
||||||
|
|
||||||
def _get_sessions_collection_path(self):
|
def _get_sessions_collection_path(self):
|
||||||
"""Helper function to find the SessionCollections path"""
|
"""Helper function to find the SessionCollections path"""
|
||||||
|
@ -43,11 +43,7 @@ class SessionServiceTestCase(base.TestCase):
|
|||||||
self.conn.get.return_value.json.side_effect = (
|
self.conn.get.return_value.json.side_effect = (
|
||||||
exceptions.AccessError(
|
exceptions.AccessError(
|
||||||
'GET', 'any_url', mock.MagicMock()))
|
'GET', 'any_url', mock.MagicMock()))
|
||||||
# Actually, it is a good thing to raise access error exceptions,
|
sessionservice.SessionService(
|
||||||
# so we know when we need to handle failures.
|
|
||||||
self.assertRaises(
|
|
||||||
exceptions.AccessError,
|
|
||||||
sessionservice.SessionService,
|
|
||||||
self.conn, '/redfish/v1/SessionService', redfish_version='1.0.2')
|
self.conn, '/redfish/v1/SessionService', redfish_version='1.0.2')
|
||||||
self.assertTrue(mock_LOG.debug.called)
|
self.assertTrue(mock_LOG.debug.called)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user