Creating OneViewException class
This exception will be inherited by all the other exceptions related to OneView operations. Considering this, it will be used in the OneView driver code in order to increase try/except granularity by replacing "except Exception" for "except OneViewException", for instance. Change-Id: I90bab3b913af608774b9c181c36e568b4b0a080b
This commit is contained in:
parent
654fd4db93
commit
857d320acf
@ -16,60 +16,64 @@
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
class OneViewConnectionError(Exception):
|
||||
message = "Can't connect to OneView"
|
||||
class OneViewException(Exception):
|
||||
message = ("An error occurred in the OneView client.")
|
||||
|
||||
|
||||
class OneViewNotAuthorizedException(Exception):
|
||||
class OneViewConnectionError(OneViewException):
|
||||
message = ("Can't connect to OneView")
|
||||
|
||||
|
||||
class OneViewNotAuthorizedException(OneViewException):
|
||||
message = ("Unauthorized access to OneView. Check the credentials used.")
|
||||
|
||||
|
||||
class OneViewResourceNotFoundError(Exception):
|
||||
class OneViewResourceNotFoundError(OneViewException):
|
||||
message = ("Resource not found in OneView")
|
||||
|
||||
|
||||
class OneViewServerProfileTemplateError(Exception):
|
||||
class OneViewServerProfileTemplateError(OneViewException):
|
||||
message = ("Server Profile Template not found in the node's driver_info")
|
||||
|
||||
|
||||
class OneViewMaxPollingAttemptsExceededError(Exception):
|
||||
class OneViewMaxPollingAttemptsExceededError(OneViewException):
|
||||
message = ("Max polling attempts to OneView exceeded")
|
||||
|
||||
|
||||
class OneViewBootDeviceInvalidError(Exception):
|
||||
class OneViewBootDeviceInvalidError(OneViewException):
|
||||
message = ("Device selected is not a valid boot device")
|
||||
|
||||
|
||||
class OneViewServerProfileAssociatedError(Exception):
|
||||
class OneViewServerProfileAssociatedError(OneViewException):
|
||||
message = ("There is no Server Profile assigned to this Server"
|
||||
" Hardware")
|
||||
|
||||
|
||||
class OneViewErrorStateSettingPowerState(Exception):
|
||||
class OneViewErrorStateSettingPowerState(OneViewException):
|
||||
message = ("Server Hardware went to error state when trying to change"
|
||||
" power state")
|
||||
|
||||
|
||||
class OneViewErrorSettingBootDevice(Exception):
|
||||
class OneViewErrorSettingBootDevice(OneViewException):
|
||||
message = ("Server Hardware went to error state when trying to change"
|
||||
" the primary boot device")
|
||||
|
||||
|
||||
class OneViewTaskError(Exception):
|
||||
class OneViewTaskError(OneViewException):
|
||||
message = ("The task for this action in OneView returned an error state")
|
||||
|
||||
|
||||
class OneViewInconsistentResource(Exception):
|
||||
class OneViewInconsistentResource(OneViewException):
|
||||
message = ("The resource is inconsistent with its OneView counterpart")
|
||||
|
||||
|
||||
class OneViewHealthStatusError(Exception):
|
||||
class OneViewHealthStatusError(OneViewException):
|
||||
message = ("There is a health status issue with an OneView Server Profile")
|
||||
|
||||
|
||||
class IncompatibleOneViewAPIVersion(Exception):
|
||||
class IncompatibleOneViewAPIVersion(OneViewException):
|
||||
message = ("The version of OneView's API is unsupported")
|
||||
|
||||
|
||||
class UnknowOneViewResponseError(Exception):
|
||||
class UnknowOneViewResponseError(OneViewException):
|
||||
message = ("OneView appliance returned an unknown response status")
|
||||
|
Loading…
x
Reference in New Issue
Block a user