Rename utils.GetUUID to utils.NewUUID.
authorMichael Hanselmann <hansmi@google.com>
Mon, 5 Nov 2007 12:14:00 +0000 (12:14 +0000)
committerMichael Hanselmann <hansmi@google.com>
Mon, 5 Nov 2007 12:14:00 +0000 (12:14 +0000)
Reviewed-by: schreiberal

lib/config.py
lib/utils.py
qa/qa_cluster.py
test/ganeti.utils_unittest.py

index 0c769d2..50fc784 100644 (file)
@@ -133,7 +133,7 @@ class ConfigWriter:
       existing.update(exceptions)
     retries = 64
     while retries > 0:
-      unique_id = utils.GetUUID()
+      unique_id = utils.NewUUID()
       if unique_id not in existing and unique_id is not None:
         break
     else:
index d5d604b..f225379 100644 (file)
@@ -847,7 +847,7 @@ def GetHomeDir(user, default=None):
   return result.pw_dir
 
 
-def GetUUID():
+def NewUUID():
   """Returns a random UUID.
 
   """
index 2995885..8b3d3eb 100644 (file)
@@ -164,7 +164,7 @@ def TestClusterCopyfile():
   """gnt-cluster copyfile"""
   master = qa_config.GetMasterNode()
 
-  uniqueid = utils.GetUUID()
+  uniqueid = utils.NewUUID()
 
   # Create temporary file
   f = tempfile.NamedTemporaryFile()
@@ -188,8 +188,8 @@ def TestClusterCommand():
   """gnt-cluster command"""
   master = qa_config.GetMasterNode()
 
-  uniqueid = utils.GetUUID()
-  rfile = "/tmp/gnt%s" % utils.GetUUID()
+  uniqueid = utils.NewUUID()
+  rfile = "/tmp/gnt%s" % utils.NewUUID()
   rcmd = utils.ShellQuoteArgs(['echo', '-n', uniqueid])
   cmd = utils.ShellQuoteArgs(['gnt-cluster', 'command',
                               "%s >%s" % (rcmd, rfile)])
index 4de493a..22c0cc4 100755 (executable)
@@ -541,14 +541,14 @@ class TestListVisibleFiles(unittest.TestCase):
     self._test(files, expected)
 
 
-class TestGetUUID(unittest.TestCase):
-  """Test case for GetUUID"""
+class TestNewUUID(unittest.TestCase):
+  """Test case for NewUUID"""
 
   _re_uuid = re.compile('^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-'
                         '[a-f0-9]{4}-[a-f0-9]{12}$')
 
   def runTest(self):
-    self.failUnless(self._re_uuid.match(utils.GetUUID()))
+    self.failUnless(self._re_uuid.match(utils.NewUUID()))
 
 
 if __name__ == '__main__':