2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-16 00:04:26 +00:00

Add OperationPolicyName filtering support for Locate

This change updates Locate operation support in the PyKMIP server,
allowing users to filter objects based on the object's Operation
Policy Name. Unit tests and integration tests have been added to
test and verify the correctness of this feature.

Additionally, the Locate demo scripts have also been updated to
support Operation Policy Name filtering. Simply use the
"--operation-policy-name" flag to specify an Operation Policy Name
string value for the Locate script to filter on.
This commit is contained in:
Peter Hamilton
2019-07-31 17:01:39 -04:00
committed by Peter Hamilton
parent 9e95d14e08
commit 942d55cca9
7 changed files with 197 additions and 0 deletions

View File

@@ -1729,6 +1729,20 @@ class KmipEngine(object):
)
add_object = False
break
elif name == "Operation Policy Name":
value = value.value
if value != attribute:
self._logger.debug(
"Failed match: "
"the specified operation policy name ({}) "
"does not match the object's operation policy "
"name ({}).".format(
value,
attribute
)
)
add_object = False
break
elif name == enums.AttributeType.INITIAL_DATE.value:
initial_date["value"] = attribute
self._track_date_attributes(