Browse Source

Merge "Revert "Raise an AccessError with SessionService init"" into stable/train

changes/27/832827/1
Zuul 6 months ago committed by Gerrit Code Review
parent
commit
84c8bb548a
  1. 7
      releasenotes/notes/session-authenication-now-raises-exception-64c5e62c1775e653.yaml
  2. 2
      sushy/resources/sessionservice/sessionservice.py
  3. 6
      sushy/tests/unit/resources/sessionservice/test_sessionservice.py

7
releasenotes/notes/session-authenication-now-raises-exception-64c5e62c1775e653.yaml

@ -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.

2
sushy/resources/sessionservice/sessionservice.py

@ -53,7 +53,6 @@ class SessionService(base.ResourceBase):
the object according to schema of given version.
:param registries: Dict of Redfish Message Registry objects to be
used in any resource that needs registries to parse messages
:raises: AccessError if resource authentication fails.
"""
try:
super(SessionService, self).__init__(
@ -64,7 +63,6 @@ class SessionService(base.ResourceBase):
'SessionService. If this happens before '
'authentication, we\'ll have to guess the Sessions URL.',
ae)
raise
def _get_sessions_collection_path(self):
"""Helper function to find the SessionCollections path"""

6
sushy/tests/unit/resources/sessionservice/test_sessionservice.py

@ -43,11 +43,7 @@ class SessionServiceTestCase(base.TestCase):
self.conn.get.return_value.json.side_effect = (
exceptions.AccessError(
'GET', 'any_url', mock.MagicMock()))
# Actually, it is a good thing to raise access error exceptions,
# so we know when we need to handle failures.
self.assertRaises(
exceptions.AccessError,
sessionservice.SessionService,
sessionservice.SessionService(
self.conn, '/redfish/v1/SessionService', redfish_version='1.0.2')
self.assertTrue(mock_LOG.debug.called)

Loading…
Cancel
Save