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

Add ApplicationSpecificInformation support to the server

This change adds ApplicationSpecificInformation attribute support
to the server, allowing for the storage and retrieval of the new
attribute in addition to object filtering based on its value. New
unit tests have been added to cover the new changes.
This commit is contained in:
Peter Hamilton
2019-10-03 15:34:38 -04:00
committed by Peter Hamilton
parent 3f84a20a0c
commit 01eb144243
7 changed files with 238 additions and 29 deletions

View File

@@ -277,28 +277,13 @@ class AttributeValueFactory(object):
return attributes.ObjectGroup(group)
def _create_application_specific_information(self, info):
if info is None:
return attributes.ApplicationSpecificInformation()
if info:
return attributes.ApplicationSpecificInformation(
application_namespace=info.get("application_namespace"),
application_data=info.get("application_data")
)
else:
application_namespace = info.get('application_namespace')
application_data = info.get('application_data')
if not isinstance(application_namespace, str):
msg = utils.build_er_error(
attributes.ApplicationSpecificInformation,
'constructor argument type',
str, type(application_namespace))
raise TypeError(msg)
if not isinstance(application_data, str):
msg = utils.build_er_error(
attributes.ApplicationSpecificInformation,
'constructor argument type',
str, type(application_data))
raise TypeError(msg)
return attributes.ApplicationSpecificInformation.create(
application_namespace, application_data)
return attributes.ApplicationSpecificInformation()
def _create_contact_information(self, info):
if info is None: