Promote unit test coverage for ClusterAction.do_recover
This patch promotes unit test coverage for ClusterAction.do_recover. Change-Id: Ic0b9a09d986b00d719aabf292aa944baa682d201
This commit is contained in:
parent
55a42cb807
commit
d5d5d5bf13
|
@ -653,9 +653,9 @@ class ClusterAction(base.Action):
|
|||
if recover_action is not None:
|
||||
# TODO(Qiming): Implement the support to action sequences
|
||||
inputs['operation'] = recover_action[0]['name']
|
||||
inputs['params'] = recover_action[0]['params']
|
||||
inputs['params'] = recover_action[0]['params'] or {}
|
||||
if fencing is not None and 'COMPUTE' in fencing:
|
||||
inputs['force'] = True
|
||||
inputs['params']['force'] = True
|
||||
|
||||
children = []
|
||||
for node in self.entity.nodes:
|
||||
|
|
|
@ -93,6 +93,7 @@ class ClusterRecoverTest(base.SenlinTestCase):
|
|||
action.data = {
|
||||
'health': {
|
||||
'recover_action': [{'name': 'REBOOT', 'params': None}],
|
||||
'fencing': ['COMPUTE'],
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,7 +112,7 @@ class ClusterRecoverTest(base.SenlinTestCase):
|
|||
action.context, 'NODE_1', 'NODE_RECOVER',
|
||||
name='node_recover_NODE_1',
|
||||
cause=consts.CAUSE_DERIVED,
|
||||
inputs={'operation': 'REBOOT', 'params': None}
|
||||
inputs={'operation': 'REBOOT', 'params': {'force': True}}
|
||||
)
|
||||
mock_dep.assert_called_once_with(action.context, ['NODE_RECOVER_ID'],
|
||||
'CLUSTER_ACTION_ID')
|
||||
|
|
Loading…
Reference in New Issue