diff --git a/oslo/vmware/exceptions.py b/oslo/vmware/exceptions.py index 3590d51..875bd22 100644 --- a/oslo/vmware/exceptions.py +++ b/oslo/vmware/exceptions.py @@ -31,6 +31,7 @@ FILE_ALREADY_EXISTS = 'FileAlreadyExists' FILE_FAULT = 'FileFault' FILE_LOCKED = 'FileLocked' FILE_NOT_FOUND = 'FileNotFound' +INVALID_POWER_STATE = 'InvalidPowerState' INVALID_PROPERTY = 'InvalidProperty' NO_PERMISSION = 'NoPermission' NOT_AUTHENTICATED = 'NotAuthenticated' @@ -168,6 +169,11 @@ class FileNotFoundException(VMwareDriverException): code = 404 +class InvalidPowerStateException(VMwareDriverException): + msg_fmt = _("Invalid power state.") + code = 409 + + class InvalidPropertyException(VMwareDriverException): msg_fmt = _("Invalid property.") code = 400 @@ -192,6 +198,7 @@ _fault_classes_registry = { FILE_FAULT: FileFaultException, FILE_LOCKED: FileLockedException, FILE_NOT_FOUND: FileNotFoundException, + INVALID_POWER_STATE: InvalidPowerStateException, INVALID_PROPERTY: InvalidPropertyException, NO_PERMISSION: NoPermissionException, NOT_AUTHENTICATED: NotAuthenticatedException,