The SubcloudInstall class have the context as a parameter, using it
to access the keystone and sysinv clients. If the context expired,
which can happen in a group restore with a group with more than 100
subclouds, an invalid token is loaded from endpoint cache and the
SysinvClient initialization fails. This commit changes the
SubcloudInstall class to always use the admin context to allow
installation on subclouds that have been on queue for more time than
the context expiry time.
Additionally, a small bug regarding install cleanup was fix. If there
was an error while initializing the SubcloudInstall class, the
cleanup would be executed regardless and fail, because the class
wasn't initialized correctly. A conditional was added to only run
cleanup if it was initialized correctly.
Test plan:
- Note: upgrade from stx8 to master is currently not functional,
but since the changes were made on the installation part,
the test could still be performed.
- PASS: Run "dcmanager subcloud deploy install" normally and verify
the installation completed successfully.
- PASS: Run "dcmanager subcloud deploy install" adding a 2h sleep
between the request and SubcloudInstall initialization and
verify the installation completed successfully.
- PASS: Upgrade a subcloud from stx8 to master normally and verify
the installation part completed sucessfully.
- PASS: Upgrade a subcloud from stx8 to master adding a 2h sleep
between the request and SubcloudInstall initialization and
verify the installation part completed sucessfully.
Closes-Bug: 2045139
Change-Id: Idcdf8faf755e655066927f543b75071afa9c43fc
Signed-off-by: Victor Romano <victor.gluzromano@windriver.com>