Allow the UUID to return a uuid object based on a provided UUID string

This commit is contained in:
Stephen Boddy 2013-10-30 17:07:23 +01:00
parent 3931a5cfe8
commit 8c07f1ac41
1 changed files with 3 additions and 1 deletions

View File

@ -277,8 +277,10 @@ def enumerate_descendants(parent):
len(terminals), parent))
return(containers, terminals)
def make_uuid():
def make_uuid(str_uuid=None):
"""Generate a UUID for an object"""
if str_uuid:
return uuid.UUID(str_uuid)
return uuid.uuid4()
def inject_uuid(target):