This commit fixes the issue that prevented a removal of a
subcloud backup stored on central storage when the subcloud
is offline.
The _create_subcloud_inventory_file() function queries the
subcloud for the bootstrap-address to write the ansible
inventory file, this is not possible when the subcloud is
offline.
When the local_only flag is False, the playbook runs locally
on the system controller, so the subcloud inventory is not
needed. This commit skips the inventory file creation when
local_only is False.
Test Plan:
PASS - Deploy a subcloud, create a subcloud backup
stored on central storage and shutdown the subcloud.
After the subcloud is offline run dcmanager subcloud
backup delete command.
PASS - Deploy a subcloud, create a subcloud backup
stored in local storage with --local-only parameter
set. Run delete command to remove the created backup.
Reviewed: https:/ /review. opendev. org/c/starlingx /distcloud/ +/891837 /opendev. org/starlingx/ distcloud/ commit/ 94b9a609798019c f4141dc5ea51217 28c113d313
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 94b9a609798019c f4141dc5ea51217 28c113d313
Author: Gustavo Pereira <email address hidden>
Date: Thu Aug 17 12:05:33 2023 -0300
Fix offline subcloud backup delete
This commit fixes the issue that prevented a removal of a
subcloud backup stored on central storage when the subcloud
is offline.
The _create_ subcloud_ inventory_ file() function queries the
subcloud for the bootstrap-address to write the ansible
inventory file, this is not possible when the subcloud is
offline.
When the local_only flag is False, the playbook runs locally
on the system controller, so the subcloud inventory is not
needed. This commit skips the inventory file creation when
local_only is False.
Test Plan:
PASS - Deploy a subcloud, create a subcloud backup
stored on central storage and shutdown the subcloud.
After the subcloud is offline run dcmanager subcloud
backup delete command.
PASS - Deploy a subcloud, create a subcloud backup
stored in local storage with --local-only parameter
set. Run delete command to remove the created backup.
Closes-bug: 2031670
Change-Id: I7f7f3441c5b6cd 3aa9f89a676283c 9d33d410aaa
Signed-off-by: Gustavo Pereira <email address hidden>