2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-22 19:23:27 +00:00

Fix AttributeError in client Rekey results with missing payloads

This change fixes a bug in the KMIPProxy client's support for the
Rekey operation. Specifically, if the operation fails and does not
return a payload, the client will still try to reference the
payload object when checking for TemplateAttribute data. This
causes an AttributeError since the payload is None. This change
fixes this and adds a unit test that covers this specific case.

Fixes #474
This commit is contained in:
Peter Hamilton
2018-12-06 16:01:09 -05:00
committed by Peter Hamilton
parent 8fd7eb5ab6
commit 4828e0d845
2 changed files with 50 additions and 3 deletions

View File

@@ -405,8 +405,9 @@ class KMIPProxy(object):
if payload:
result['unique_identifier'] = payload.unique_identifier
if payload.template_attribute is not None:
result['template_attribute'] = payload.template_attribute
if payload.template_attribute is not None:
result['template_attribute'] = payload.template_attribute
result['result_status'] = batch_item.result_status.value
try: