mirror of
https://github.com/openkmip/pykmip
synced 2025-12-24 04:04:20 +00:00
Reorganizing message payload code
This change is primarily a reorganization of the message payload code originally found in kmip/core/messages/operations.py. The code from that module has been moved to a new package, kmip.core.messages.payloads, and split into separate modules according to each supported KMIP operation. The surrounding KMIP codebase has been updated to use the new package structure and a placeholder test suite has been put in place for future tests. This change does NOT include test cases as these would primarily be a refactoring from the current test suite found in kmip/tests/core/messages/test_messages.py and that work has not been done yet.
This commit is contained in:
@@ -19,7 +19,7 @@ from kmip.core.messages import contents
|
||||
from kmip.core.messages.contents import AsynchronousCorrelationValue
|
||||
from kmip.core.messages.contents import BatchErrorContinuationOption
|
||||
|
||||
from kmip.core.messages import operations
|
||||
from kmip.core.messages import payloads
|
||||
|
||||
from kmip.core.primitives import Struct
|
||||
|
||||
@@ -194,7 +194,7 @@ class RequestBatchItem(Struct):
|
||||
self.unique_batch_item_id.read(tstream)
|
||||
|
||||
# Lookup the response payload class that belongs to the operation
|
||||
cls = operations.REQUEST_MAP.get(self.operation.enum)
|
||||
cls = payloads.REQUEST_MAP.get(self.operation.enum)
|
||||
self.request_payload = cls()
|
||||
self.request_payload.read(tstream)
|
||||
|
||||
@@ -281,7 +281,7 @@ class ResponseBatchItem(Struct):
|
||||
self.async_correlation_value.read(tstream)
|
||||
|
||||
# Lookup the response payload class that belongs to the operation
|
||||
cls = operations.RESPONSE_MAP.get(self.operation.enum)
|
||||
cls = payloads.RESPONSE_MAP.get(self.operation.enum)
|
||||
expected = cls()
|
||||
if self.is_tag_next(expected.tag, tstream):
|
||||
self.response_payload = cls()
|
||||
|
||||
Reference in New Issue
Block a user