Missing validation for bootstrap_address in restore_values
When providing the bootstrap_address in restore_values, there wasn't
a validation to ensure the provided value had a valid format. Right
now, the address is added in inventory exactly as provided and will
fail when running the Ansible playbook.
This review includes a validation step that evaluates the IP address
value and raises an exception in case it isn't valid, aborting the
process for the invalid subcloud.
Test plan:
All test cases were performed after a subcloud was deployed and
had its backup taken.
Success cases:
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
using the restore_values.yml file with a valid IP address. The
subcloud was successfully restored.
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
group using the restore_values.yml file with a valid IP address
for a subcloud and an invalid one for another. The subcloud
with the valid IP address was successfully restored.
Failure cases:
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
using the restore_values.yml file with an invalid IP address.
An error appears in the console stating that the IP address
is invalid for the specified subcloud.
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
group using the restore_values.yml file with a valid IP address
for a subcloud and an invalid one for another. The subcloud with
the invalid IP address wasn't restored.
Reviewed: https:/ /review. opendev. org/c/starlingx /distcloud/ +/901911 /opendev. org/starlingx/ distcloud/ commit/ 4141cc8b160d120 8d6aa3a6717963f 4a588a92d1
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 4141cc8b160d120 8d6aa3a6717963f 4a588a92d1
Author: rlima <email address hidden>
Date: Mon Nov 27 09:07:23 2023 -0300
Missing validation for bootstrap_address in restore_values
When providing the bootstrap_address in restore_values, there wasn't
a validation to ensure the provided value had a valid format. Right
now, the address is added in inventory exactly as provided and will
fail when running the Ansible playbook.
This review includes a validation step that evaluates the IP address
value and raises an exception in case it isn't valid, aborting the
process for the invalid subcloud.
Test plan:
All test cases were performed after a subcloud was deployed and
had its backup taken.
Success cases:
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
using the restore_values.yml file with a valid IP address. The
subcloud was successfully restored.
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
group using the restore_values.yml file with a valid IP address
for a subcloud and an invalid one for another. The subcloud
with the valid IP address was successfully restored.
Failure cases:
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
using the restore_values.yml file with an invalid IP address.
An error appears in the console stating that the IP address
is invalid for the specified subcloud.
- PASS: Run 'dcmanager subcloud-backup restore' for a subcloud
group using the restore_values.yml file with a valid IP address
for a subcloud and an invalid one for another. The subcloud with
the invalid IP address wasn't restored.
Closes-Bug: 2044551
Change-Id: Ie9f937db1185aa 242112efba17741 d97707181f3
Signed-off-by: rlima <email address hidden>