components/openstack/heat/patches/03-uuid-format.patch
author Drew Fisher <drew.fisher@oracle.com>
Tue, 05 Aug 2014 08:29:43 -0600
changeset 2025 8dbf23e740f2
permissions -rw-r--r--
PSARC/2014/236 OpenStack Heat (OpenStack Orchestration Service) 19120578 Request to integrate Heat into userland

In-house patch to force the conversion of UUIDs to UUID version 4.
libuuid in Solaris does not set the version of UUID correctly (bug
15391420).
--- heat-2013.2.3/heat/common/short_id.py.orig	2014-06-26 11:03:04.050413825 -0600
+++ heat-2013.2.3/heat/common/short_id.py	2014-06-26 11:04:48.397644826 -0600
@@ -38,9 +38,10 @@
     The supplied UUID must be a version 4 UUID object.
     '''
     if isinstance(source_uuid, basestring):
-        source_uuid = uuid.UUID(source_uuid)
-    if source_uuid.version != 4:
-        raise ValueError('Invalid UUID version (%d)' % source_uuid.version)
+        try:
+            source_uuid = uuid.UUID(source_uuid, version=4)
+        except ValueError:
+            raise ValueError('Invalid UUID: %s' % source_uuid)
 
     # The "time" field of a v4 UUID contains 60 random bits
     # (see RFC4122, Section 4.4)