Commit 437138c9 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Convert mcpu.py

Replacing ssconf with configuration.

Reviewed-by: iustinp
parent 5b263ed7
......@@ -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)
......@@ -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"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment