2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-15 07:43:26 +00:00

Adding server support for the Activate operation

This change adds support for the Activate operation to the server,
including additional server unit tests, a new IllegalOperation
exception, and updated state attribute support in Pie objects.

Fixes #186
This commit is contained in:
Peter Hamilton
2016-08-28 12:39:00 -04:00
parent 2a7c45e97a
commit b7cc542d9a
4 changed files with 255 additions and 1 deletions

View File

@@ -57,6 +57,26 @@ class CryptographicFailure(KmipError):
)
class IllegalOperation(KmipError):
"""
An error generated when an improper operation is attempted. The operation
can be 'illegal' for various reasons, including invalid permissions or
literal object/operation mismatch (e.g., a Template item cannot be
activated with the Activate operation since it has no state).
"""
def __init__(self, message):
"""
Create an IllegalOperation exception.
Args:
message (string): A string containing information about the error.
"""
super(IllegalOperation, self).__init__(
reason=enums.ResultReason.ILLEGAL_OPERATION,
message=message
)
class IndexOutOfBounds(KmipError):
"""
An error generated when exceeding the attribute instance limit.