Adding a runtime configuration library
[ganeti-local] / test / mocks.py
index 4c0ae07..b2fb139 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007 Google Inc.
+# Copyright (C) 2006, 2007, 2010 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 """Module implementing a fake ConfigWriter"""
 
 from ganeti import utils
+from ganeti import netutils
 
 
 FAKE_CLUSTER_KEY = ("AAAAB3NzaC1yc2EAAAABIwAAAQEAsuGLw70et3eApJ/ZEJkAVZogIrm"
@@ -49,12 +50,18 @@ class FakeConfig:
         return "test.cluster"
 
     def GetMasterNode(self):
-        return utils.HostInfo().name
+        return netutils.Hostname.GetSysName()
+
+    def GetDefaultIAllocator(Self):
+        return "testallocator"
 
 
 class FakeProc:
     """Fake processor object"""
 
+    def Log(self, msg, *args, **kwargs):
+        pass
+
     def LogWarning(self, msg, *args, **kwargs):
         pass