direct-io.hg

changeset 12075:a3788998952d

[XEND] Add a convenience function for UUID generation

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Thu Oct 05 17:29:19 2006 +0100 (2006-10-05)
parents 4fd97b9aa31e
children 137d40894a8b
files tools/python/xen/xend/uuid.py
line diff
     1.1 --- a/tools/python/xen/xend/uuid.py	Thu Oct 05 17:29:19 2006 +0100
     1.2 +++ b/tools/python/xen/xend/uuid.py	Thu Oct 05 17:29:19 2006 +0100
     1.3 @@ -54,10 +54,6 @@ def getUuidRandom():
     1.4  uuidFactory = getUuidRandom
     1.5  
     1.6  
     1.7 -def create():
     1.8 -    return uuidFactory()
     1.9 -
    1.10 -
    1.11  def toString(u):
    1.12      return "-".join(["%02x" * 4, "%02x" * 2, "%02x" * 2, "%02x" * 2,
    1.13                       "%02x" * 6]) % tuple(u)
    1.14 @@ -65,3 +61,9 @@ def toString(u):
    1.15  def fromString(s):
    1.16      s = s.replace('-', '')
    1.17      return [ int(s[i : i + 2], 16) for i in range(0, 32, 2) ]
    1.18 +
    1.19 +def create():
    1.20 +    return uuidFactory()
    1.21 +
    1.22 +def createString():
    1.23 +    return toString(create())