On Mon, Aug 24, 2009 at 01:59:12PM +0200, Michael Hanselmann wrote:
> 2009/8/24 Iustin Pop <[email protected]>:
> > The mcpu.py:HooksMaster class needs to have a proc attribute/argument to
> > init in ordet to call its LogWarning method. However, this is available
> > from the 'lu' attribute, so we can remove this dependency.
>
> LGTM
Oops, forgot this interdiff:
diff --git a/test/ganeti.hooks_unittest.py b/test/ganeti.hooks_unittest.py
index 5826f9b..55fa721 100755
--- a/test/ganeti.hooks_unittest.py
+++ b/test/ganeti.hooks_unittest.py
@@ -240,14 +240,14 @@ class TestHooksMaster(unittest.TestCase):
def testTotalFalse(self):
"""Test complete rpc failure"""
- hm = mcpu.HooksMaster(self._call_false, FakeProc(), self.lu)
+ hm = mcpu.HooksMaster(self._call_false, self.lu)
self.failUnlessRaises(errors.HooksFailure,
hm.RunPhase, constants.HOOKS_PHASE_PRE)
hm.RunPhase(constants.HOOKS_PHASE_POST)
def testIndividualFalse(self):
"""Test individual node failure"""
- hm = mcpu.HooksMaster(self._call_nodes_false, FakeProc(), self.lu)
+ hm = mcpu.HooksMaster(self._call_nodes_false, self.lu)
hm.RunPhase(constants.HOOKS_PHASE_PRE)
#self.failUnlessRaises(errors.HooksFailure,
# hm.RunPhase, constants.HOOKS_PHASE_PRE)
@@ -255,14 +255,14 @@ class TestHooksMaster(unittest.TestCase):
def testScriptFalse(self):
"""Test individual rpc failure"""
- hm = mcpu.HooksMaster(self._call_script_fail, FakeProc(), self.lu)
+ hm = mcpu.HooksMaster(self._call_script_fail, self.lu)
self.failUnlessRaises(errors.HooksAbort,
hm.RunPhase, constants.HOOKS_PHASE_PRE)
hm.RunPhase(constants.HOOKS_PHASE_POST)
def testScriptSucceed(self):
"""Test individual rpc failure"""
- hm = mcpu.HooksMaster(self._call_script_succeed, FakeProc(), self.lu)
+ hm = mcpu.HooksMaster(self._call_script_succeed, self.lu)
for phase in (constants.HOOKS_PHASE_PRE, constants.HOOKS_PHASE_POST):
hm.RunPhase(phase)
iustin