Make fencing action parameter optional.

We no longer force a default value for the fencing action parameter,
allowing the accompanying Mistral action to only include one in the
parameters when it has been specified.

Change-Id: I2f160e920a18ce9d7cc4b168d6074f5d636aaeda
Closes-Bug: #1670687
This commit is contained in:
Chris Jones 2017-03-07 13:53:08 +00:00
parent ab39a5a30b
commit 1eb71a3d4c
3 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,8 @@
---
fixes:
- |
The `overcloud generate fencing` command no longer carries a default value
for the `action` parameter. Advice from upstream Pacemaker is that this
value should no longer be passed to fencing agents as it may cause
inconsistent behaviour. The parameter remains, but is now optional, and
its use is discouraged.

View File

@ -145,7 +145,7 @@ class TestGenerateFencingParameters(utils.TestCommand):
self.workflow.action_executions.create.assert_called_once_with(
'tripleo.parameters.generate_fencing',
{
'fence_action': 'reboot',
'fence_action': None,
'nodes_json': [
{
u'mac': [u'00:11:22:33:44:55'],

View File

@ -75,10 +75,10 @@ class GenerateFencingParameters(command.Command):
def get_parser(self, prog_name):
parser = super(GenerateFencingParameters, self).get_parser(prog_name)
parser.add_argument('-a', '--action', dest='fence_action',
default='reboot',
help=_('Operation to perform. Valid operations: '
'on, off, reboot, status, list, diag, '
'monitor or metadata. Defaults to: reboot'))
'monitor or metadata. You should generally '
'not use this option.'))
parser.add_argument('--delay', type=int,
help=_('Wait DELAY seconds before fencing is '
'started'))