First system load-delete failed after upgrade SX

The load-delete function calls sw-patch del-release function
that tries to delete a 'version' key from a dictionary that
does not exists.

This dictionary is populated looping the folders inside
/www/pages/feed. Each folder is a version imported.
After the upgrade the old version folder is deleted,
the version is not include at the dictionary.

The solution was to verify if this key exists before deleting.

The following tests
Tested load-delete action on a SX system after load-import
Tested load-delete action on a SX system after upgrade-complete

Closes-Bug: 1940302
Signed-off-by: João Pedro Alexandroni Cordova de Sousa <JoaoPedroAlexandroni.CordovadeSouza@windriver.com>
Change-Id: I83f8d144edd53523a98402fbee71dce1507fc79c
This commit is contained in:
João Pedro Alexandroni Cordova de Sousa 2021-08-17 11:13:48 -03:00
parent a79efa7442
commit 65fafcf146
1 changed files with 1 additions and 1 deletions

View File

@ -1645,7 +1645,7 @@ class PatchController(PatchService):
del repo_dir[release]
if self.base_pkgdata is not None:
if self.base_pkgdata is not None and release in self.base_pkgdata.pkgs:
del self.base_pkgdata.pkgs[release]
# Refresh patch data