mirror of
https://github.com/OpenKMIP/PyKMIP.git
synced 2025-07-21 21:14:24 +02:00
Fixing stringent uid value checks in the ProxyKmipClient
This change loosens the input requirements for ProxyKmipClient operations that accept a secret UID. Operations like Get and Destroy used to require a string value but are allowed in the KMIP specification to take no value at all. This change updates the ProxyKmipClient to properly reflect the specification. The underlying KMIPProxy client is mostly unchanged. Closes #261
This commit is contained in:
parent
0faf1e5f43
commit
fae811528b
@ -391,7 +391,7 @@ class ProxyKmipClient(api.KmipClient):
|
|||||||
message = result.result_message.value
|
message = result.result_message.value
|
||||||
raise exceptions.KmipOperationFailure(status, reason, message)
|
raise exceptions.KmipOperationFailure(status, reason, message)
|
||||||
|
|
||||||
def get(self, uid):
|
def get(self, uid=None):
|
||||||
"""
|
"""
|
||||||
Get a managed object from a KMIP appliance.
|
Get a managed object from a KMIP appliance.
|
||||||
|
|
||||||
@ -407,6 +407,7 @@ class ProxyKmipClient(api.KmipClient):
|
|||||||
TypeError: if the input argument is invalid
|
TypeError: if the input argument is invalid
|
||||||
"""
|
"""
|
||||||
# Check input
|
# Check input
|
||||||
|
if uid is not None:
|
||||||
if not isinstance(uid, six.string_types):
|
if not isinstance(uid, six.string_types):
|
||||||
raise TypeError("uid must be a string")
|
raise TypeError("uid must be a string")
|
||||||
|
|
||||||
@ -541,7 +542,7 @@ class ProxyKmipClient(api.KmipClient):
|
|||||||
message = result.result_message.value
|
message = result.result_message.value
|
||||||
raise exceptions.KmipOperationFailure(status, reason, message)
|
raise exceptions.KmipOperationFailure(status, reason, message)
|
||||||
|
|
||||||
def destroy(self, uid):
|
def destroy(self, uid=None):
|
||||||
"""
|
"""
|
||||||
Destroy a managed object stored by a KMIP appliance.
|
Destroy a managed object stored by a KMIP appliance.
|
||||||
|
|
||||||
@ -557,6 +558,7 @@ class ProxyKmipClient(api.KmipClient):
|
|||||||
TypeError: if the input argument is invalid
|
TypeError: if the input argument is invalid
|
||||||
"""
|
"""
|
||||||
# Check input
|
# Check input
|
||||||
|
if uid is not None:
|
||||||
if not isinstance(uid, six.string_types):
|
if not isinstance(uid, six.string_types):
|
||||||
raise TypeError("uid must be a string")
|
raise TypeError("uid must be a string")
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ class KMIPProxy(KMIP):
|
|||||||
revocation_message=message,
|
revocation_message=message,
|
||||||
credential=credential)
|
credential=credential)
|
||||||
|
|
||||||
def destroy(self, uuid, credential=None):
|
def destroy(self, uuid=None, credential=None):
|
||||||
return self._destroy(unique_identifier=uuid,
|
return self._destroy(unique_identifier=uuid,
|
||||||
credential=credential)
|
credential=credential)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user