diff --git a/releasenotes/notes/unsupported-http-status-code-05af22dbecc517f7.yaml b/releasenotes/notes/unsupported-http-status-code-05af22dbecc517f7.yaml new file mode 100644 index 00000000..7674ac25 --- /dev/null +++ b/releasenotes/notes/unsupported-http-status-code-05af22dbecc517f7.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + The HTTP status code for NotSupportedError has been fixed. The generic + ``500 Internal Server Error`` status code was previously used, it will now + use the ``501 Not Implemented`` status code. + diff --git a/sushy_tools/error.py b/sushy_tools/error.py index 8530308d..ea34a82a 100644 --- a/sushy_tools/error.py +++ b/sushy_tools/error.py @@ -29,8 +29,8 @@ class AliasAccessError(FishyError): class NotSupportedError(FishyError): """Feature not supported by resource driver""" - def __init__(self, msg='Unsupported'): - super().__init__(msg) + def __init__(self, msg='Unsupported', code=501): + super().__init__(msg, code) class NotFound(FishyError):