mirror of
https://github.com/openkmip/pykmip
synced 2026-01-21 03:43:26 +00:00
Update object hierarchy read/write to support the KMIP version
This change updates the PyKMIP object hierarchy's read/write method signatures to support propagation of the KMIP version. The introduction of KMIP 2.0 introduces future KMIP message encodings that break backwards compatibility; to support this, PyKMIP must know what KMIP version is being used when encoding or decoding an object; the KMIP version residing in the client or server alone is now insufficient. Prior versions of KMIP, namely 1.0 - 1.4, have been backwards compatible, obviating the need for the KMIP version at encode/decode time. Going forward, this is no longer true. The PyKMIP client and server have been updated to include the KMIP version when making calls to read/write, as have the associated test cases covering this functionality.
This commit is contained in:
committed by
Peter Hamilton
parent
c012a430aa
commit
dcade2a264
@@ -116,6 +116,7 @@ class KmipEngine(object):
|
||||
contents.ProtocolVersion(1, 0)
|
||||
]
|
||||
|
||||
self.default_protocol_version = self._protocol_versions[2]
|
||||
self._protocol_version = self._protocol_versions[2]
|
||||
|
||||
self._object_map = {
|
||||
@@ -308,7 +309,7 @@ class KmipEngine(object):
|
||||
response_batch
|
||||
)
|
||||
|
||||
return response, max_response_size
|
||||
return response, max_response_size, header.protocol_version
|
||||
|
||||
def _build_response(self, version, batch_items):
|
||||
header = messages.ResponseHeader(
|
||||
|
||||
Reference in New Issue
Block a user