2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-15 15:53:36 +00:00

Add optional 'name' argument to create and create_key_pair functions

The ProxyKmipClient now allows you to optionally provide a name
when performing a `Create` or a `Create Key Pair`. If not specified,
the name is excluded from the request.

 * For `create`, users specify `name`
 * For `create_key_pair`, users specify `private_name` and `public_name`

Resolves #208
This commit is contained in:
Jonathan Seawright
2016-12-01 15:45:04 -06:00
parent d1b01b75f9
commit 9ba479e4d3
6 changed files with 230 additions and 20 deletions

View File

@@ -154,6 +154,9 @@ class Name(Struct):
@classmethod
def create(cls, name_value, name_type):
'''
Returns a Name object, populated with the given value and type
'''
if isinstance(name_value, Name.NameValue):
value = name_value
elif isinstance(name_value, str):
@@ -200,6 +203,9 @@ class Name(Struct):
else:
return NotImplemented
def __ne__(self, other):
return not self.__eq__(other)
# 3.3
class ObjectType(Enumeration):