Replacing ssconf with configuration.
---
lib/mcpu.py | 10 ++++------
test/mocks.py | 6 ++++++
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/lib/mcpu.py b/lib/mcpu.py
index ff5b856..7b65252 100644
--- a/lib/mcpu.py
+++ b/lib/mcpu.py
@@ -287,9 +287,9 @@ class HooksMaster(object):
env = self.env.copy()
env["GANETI_HOOKS_PHASE"] = phase
env["GANETI_HOOKS_PATH"] = hpath
- if self.lu.sstore is not None:
- env["GANETI_CLUSTER"] = self.lu.sstore.GetClusterName()
- env["GANETI_MASTER"] = self.lu.sstore.GetMasterNode()
+ if self.lu.cfg is not None:
+ env["GANETI_CLUSTER"] = self.lu.cfg.GetClusterName()
+ env["GANETI_MASTER"] = self.lu.cfg.GetMasterNode()
env = dict([(str(key), str(val)) for key, val in env.iteritems()])
@@ -340,7 +340,5 @@ class HooksMaster(object):
"""
phase = constants.HOOKS_PHASE_POST
hpath = constants.HOOKS_NAME_CFGUPDATE
- if self.lu.sstore is None:
- raise errors.ProgrammerError("Null sstore on config update hook")
- nodes = [self.lu.sstore.GetMasterNode()]
+ nodes = [self.lu.cfg.GetMasterNode()]
results = self._RunWrapper(nodes, hpath, phase)
diff --git a/test/mocks.py b/test/mocks.py
index 442709c..c611285 100644
--- a/test/mocks.py
+++ b/test/mocks.py
@@ -48,6 +48,12 @@ class FakeConfig:
def GetHostKey(self):
return FAKE_CLUSTER_KEY
+ def GetClusterName(self):
+ return "test.cluster"
+
+ def GetMasterNode(self):
+ return utils.HostInfo().name
+
class FakeSStore:
"""Fake simplestore object"""
--
1.6.0.2