Fix config and metadata in cluster update
The config or metadata in cluster update should only be sent if the values is not None. Sending empty dictionary will override any existing config or metadata setting. Change-Id: Id23e743d1db30a0549d06081e87249a0dbd326a2
This commit is contained in:
@@ -304,11 +304,16 @@ class UpdateCluster(command.ShowOne):
|
||||
parsed_args.profile_only,
|
||||
strict=True,
|
||||
),
|
||||
'metadata': senlin_utils.format_parameters(parsed_args.metadata),
|
||||
'config': senlin_utils.format_parameters(parsed_args.config),
|
||||
'timeout': parsed_args.timeout,
|
||||
}
|
||||
|
||||
if parsed_args.config is not None:
|
||||
attrs['config'] = senlin_utils.format_parameters(
|
||||
parsed_args.config)
|
||||
if parsed_args.metadata is not None:
|
||||
attrs['metadata'] = senlin_utils.format_parameters(
|
||||
parsed_args.metadata)
|
||||
|
||||
senlin_client.update_cluster(cluster, **attrs)
|
||||
return _show_cluster(senlin_client, cluster.id)
|
||||
|
||||
|
Reference in New Issue
Block a user