Currently, all parameter values are being enclosed in quotes when
parsing the subcloud update request. This works fine for string
parameters (description, location, group-id, etc.), however it causes
an issue with the install-values parameter, since it's an yaml file.
This causes the yaml.safe_load() to return a string instead of a
dictionary with the parsed install-values content.
This fix simplifies the parsing function (_get_patch_data) by only
applying the yaml.safe_load() function to the install-values parameter.
Enclosing the fields in quotes is not necessary anymore (related to
issue #1989619, change #857762).
Test plan:
PASS: Update the subcloud description and location through Horizon;
PASS: Update the subcloud with the --install-values parameter through
the CLI.
PASS: Manage a subcloud with the --force parameter (the subcloud manage
command uses the subcloud update endpoint and accepts the --force
param.)
Reviewed: https:/ /review. opendev. org/c/starlingx /distcloud/ +/863669 /opendev. org/starlingx/ distcloud/ commit/ 2c8cf582df4c28f 600f17e3e6fff83 1176c2afa9
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 2c8cf582df4c28f 600f17e3e6fff83 1176c2afa9
Author: Gustavo Herzmann <email address hidden>
Date: Fri Nov 4 11:44:33 2022 -0300
Fix update install-values for subclouds
Currently, all parameter values are being enclosed in quotes when
parsing the subcloud update request. This works fine for string
parameters (description, location, group-id, etc.), however it causes
an issue with the install-values parameter, since it's an yaml file.
This causes the yaml.safe_load() to return a string instead of a
dictionary with the parsed install-values content.
This fix simplifies the parsing function (_get_patch_data) by only
applying the yaml.safe_load() function to the install-values parameter.
Enclosing the fields in quotes is not necessary anymore (related to
issue #1989619, change #857762).
Test plan:
PASS: Update the subcloud description and location through Horizon;
PASS: Update the subcloud with the --install-values parameter through
the CLI.
PASS: Manage a subcloud with the --force parameter (the subcloud manage
command uses the subcloud update endpoint and accepts the --force
param.)
Closes-Bug: #1995716
Related-bug: #1989619
Signed-off-by: Gustavo Herzmann <email address hidden> bd480914eac6b65 9be3e021d19
Change-Id: I40194f1b6bf7a8