2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-20 18:23:24 +00:00

messages: response batch item without 'operation'

Batch item of error response message can be without 'operation'
attribute
This commit is contained in:
Viktor Tarasov
2016-03-29 11:38:51 +02:00
parent 8cc7c5f8e0
commit fec1aa1f4a
2 changed files with 58 additions and 6 deletions

View File

@@ -288,12 +288,13 @@ class ResponseBatchItem(Struct):
self.async_correlation_value = AsynchronousCorrelationValue()
self.async_correlation_value.read(tstream)
# Dynamically create the response payload class that belongs to the
# operation
expected = self.payload_factory.create(self.operation.value)
if self.is_tag_next(expected.tag, tstream):
self.response_payload = expected
self.response_payload.read(tstream)
if (self.operation is not None):
# Dynamically create the response payload class that belongs to the
# operation
expected = self.payload_factory.create(self.operation.value)
if self.is_tag_next(expected.tag, tstream):
self.response_payload = expected
self.response_payload.read(tstream)
# Read the message extension if it is present
if self.is_tag_next(Tags.MESSAGE_EXTENSION, tstream):