Remove existing dc-vault load data during import

During a distributed cloud upgrade, an admin may need to delete and
import a new load. If the load-delete command is issued without the
--os-region-name SystemController parameter the load will be deleted
from sysinv but will still be present in the dc-vault.

To resolve this we will always remove any existing dc-vault data during
a load import.

Closes-Bug: 1918451
Signed-off-by: David Sullivan <david.sullivan@windriver.com>
Change-Id: I143e2c084205c105f084d96714e8ebef94dbd130
This commit is contained in:
David Sullivan 2021-03-10 10:19:51 -06:00
parent 1cd64cba00
commit c4a208325c
1 changed files with 4 additions and 3 deletions

View File

@ -469,9 +469,10 @@ class SysinvAPIController(APIController):
sw_version)
try:
if self._is_active_load(sw_version):
LOG.info("_save_load_to_vault remove prior %s" % sw_version)
self._remove_load_from_vault(sw_version)
# Remove any existing loads in the vault. At this point sysinv has
# validated/added the load so we must match the DC vault to that.
LOG.info("_save_load_to_vault remove prior %s" % sw_version)
self._remove_load_from_vault(sw_version)
if not os.path.isdir(versioned_vault):
os.makedirs(versioned_vault)