From 1eb71a3d4c062f51327a74d6ab6a9f4062e2d683 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 7 Mar 2017 13:53:08 +0000 Subject: [PATCH] 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 --- .../fix-fencing-action-parameter-8321d25a23d8ef99.yaml | 8 ++++++++ tripleoclient/tests/v1/test_overcloud_parameters.py | 2 +- tripleoclient/v1/overcloud_parameters.py | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix-fencing-action-parameter-8321d25a23d8ef99.yaml diff --git a/releasenotes/notes/fix-fencing-action-parameter-8321d25a23d8ef99.yaml b/releasenotes/notes/fix-fencing-action-parameter-8321d25a23d8ef99.yaml new file mode 100644 index 000000000..ff33a976b --- /dev/null +++ b/releasenotes/notes/fix-fencing-action-parameter-8321d25a23d8ef99.yaml @@ -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. diff --git a/tripleoclient/tests/v1/test_overcloud_parameters.py b/tripleoclient/tests/v1/test_overcloud_parameters.py index b8c52e381..fc459107a 100644 --- a/tripleoclient/tests/v1/test_overcloud_parameters.py +++ b/tripleoclient/tests/v1/test_overcloud_parameters.py @@ -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'], diff --git a/tripleoclient/v1/overcloud_parameters.py b/tripleoclient/v1/overcloud_parameters.py index e083f3018..957d20a57 100644 --- a/tripleoclient/v1/overcloud_parameters.py +++ b/tripleoclient/v1/overcloud_parameters.py @@ -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'))