mirror of https://github.com/OpenKMIP/PyKMIP.git
Merge pull request #229 from OpenKMIP/bug/fix-client-attribute-handling
Fixing a bug with attribute handling in ProxyKmipClient.register
This commit is contained in:
commit
49d0f366fc
|
@ -297,17 +297,19 @@ class ProxyKmipClient(api.KmipClient):
|
||||||
object_attributes = list()
|
object_attributes = list()
|
||||||
|
|
||||||
if hasattr(managed_object, 'cryptographic_usage_masks'):
|
if hasattr(managed_object, 'cryptographic_usage_masks'):
|
||||||
mask_attribute = self.attribute_factory.create_attribute(
|
if managed_object.cryptographic_usage_masks is not None:
|
||||||
enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK,
|
mask_attribute = self.attribute_factory.create_attribute(
|
||||||
managed_object.cryptographic_usage_masks
|
enums.AttributeType.CRYPTOGRAPHIC_USAGE_MASK,
|
||||||
)
|
managed_object.cryptographic_usage_masks
|
||||||
object_attributes.append(mask_attribute)
|
)
|
||||||
|
object_attributes.append(mask_attribute)
|
||||||
if hasattr(managed_object, 'operation_policy_name'):
|
if hasattr(managed_object, 'operation_policy_name'):
|
||||||
opn_attribute = self.attribute_factory.create_attribute(
|
if managed_object.operation_policy_name is not None:
|
||||||
enums.AttributeType.OPERATION_POLICY_NAME,
|
opn_attribute = self.attribute_factory.create_attribute(
|
||||||
managed_object.operation_policy_name
|
enums.AttributeType.OPERATION_POLICY_NAME,
|
||||||
)
|
managed_object.operation_policy_name
|
||||||
object_attributes.append(opn_attribute)
|
)
|
||||||
|
object_attributes.append(opn_attribute)
|
||||||
|
|
||||||
template = cobjects.TemplateAttribute(attributes=object_attributes)
|
template = cobjects.TemplateAttribute(attributes=object_attributes)
|
||||||
object_type = managed_object.object_type
|
object_type = managed_object.object_type
|
||||||
|
|
|
@ -959,7 +959,9 @@ class TestProxyKmipClient(testtools.TestCase):
|
||||||
enums.CryptographicAlgorithm.AES,
|
enums.CryptographicAlgorithm.AES,
|
||||||
128,
|
128,
|
||||||
(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E'
|
(b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E'
|
||||||
b'\x0F'))
|
b'\x0F')
|
||||||
|
)
|
||||||
|
key.operation_policy_name = 'default'
|
||||||
|
|
||||||
result = results.RegisterResult(
|
result = results.RegisterResult(
|
||||||
contents.ResultStatus(enums.ResultStatus.SUCCESS),
|
contents.ResultStatus(enums.ResultStatus.SUCCESS),
|
||||||
|
|
Loading…
Reference in New Issue