Send config parameters in cluster update

This patch set fixes a bug where config parameter was not send correctly
as part of cluster update.

Change-Id: I38d4a56a55cbb870c2afe1fa9de7564b5748dfba
Closes-Bug: #1896260
This commit is contained in:
Duc Truong 2020-09-18 16:41:09 +00:00
parent 13530356a8
commit 74ece12e32
2 changed files with 9 additions and 2 deletions

View File

@ -273,6 +273,9 @@ class TestClusterUpdate(TestCluster):
"nk1": "nv1", "nk1": "nv1",
"nk2": "nv2", "nk2": "nv2",
}, },
"config": {
"cluster.stop_node_before_delete": "true",
},
"name": 'new_cluster', "name": 'new_cluster',
"profile_id": 'new_profile', "profile_id": 'new_profile',
"profile_only": False, "profile_only": False,
@ -314,6 +317,7 @@ class TestClusterUpdate(TestCluster):
def test_cluster_update_defaults(self): def test_cluster_update_defaults(self):
arglist = ['--name', 'new_cluster', '--metadata', 'nk1=nv1;nk2=nv2', arglist = ['--name', 'new_cluster', '--metadata', 'nk1=nv1;nk2=nv2',
'--config', 'cluster.stop_node_before_delete=true',
'--profile', 'new_profile', '--timeout', '30', '45edadcb'] '--profile', 'new_profile', '--timeout', '30', '45edadcb']
parsed_args = self.check_parser(self.cmd, arglist, []) parsed_args = self.check_parser(self.cmd, arglist, [])
self.cmd.take_action(parsed_args) self.cmd.take_action(parsed_args)

View File

@ -243,9 +243,11 @@ class UpdateCluster(command.ShowOne):
parser.add_argument( parser.add_argument(
'--config', '--config',
metavar='<"key1=value1;key2=value2...">', metavar='<"key1=value1;key2=value2...">',
help=_('s of the cluster. Default to {}. ' help=_('Configuration of the cluster. '
'This can be specified multiple times, or once with ' 'This can be specified multiple times, or once with '
'key-value pairs separated by a semicolon.'), 'key-value pairs separated by a semicolon. '
'Any existing configuration values on the cluster are '
'wiped out when using this option.'),
action='append' action='append'
) )
parser.add_argument( parser.add_argument(
@ -303,6 +305,7 @@ class UpdateCluster(command.ShowOne):
strict=True, strict=True,
), ),
'metadata': senlin_utils.format_parameters(parsed_args.metadata), 'metadata': senlin_utils.format_parameters(parsed_args.metadata),
'config': senlin_utils.format_parameters(parsed_args.config),
'timeout': parsed_args.timeout, 'timeout': parsed_args.timeout,
} }