Execute undercloud preflight validations via VF binary

Execute undercloud preflight validations via the Validation Framework
binary instead of via the VF API avoid breakage when an API change is introduce.
Its also fix some issues present in the previous implementation:
- the validations was logged in /tmp instead of the /var/log/validations,
  so the logs wasn't shown in the CLI history command.
- the results of the executed validations was never checked, so when the
  validations was failing, the undercloud install can still continue

Closes-Bug: #1995641

Change-Id: I149932625fe474175e3842fa52adfea30021ab5c
(cherry picked from commit 66156f7395)
This commit is contained in:
Douglas Viroel 2022-11-03 17:59:05 -03:00
parent f9ab99cf04
commit 3e496feb67
1 changed files with 4 additions and 10 deletions

View File

@ -30,8 +30,6 @@ from oslo_config import cfg
from tripleoclient import constants
from tripleoclient import utils
from validations_libs.validation_actions import ValidationActions
class FailedValidation(Exception):
@ -63,7 +61,7 @@ def _run_live_command(args, env=None, name=None, cwd=None, wait=True):
return process
while True:
line = process.stdout.readline().decode('utf-8')
line = process.stdout.readline()
if line:
if line == '' and process.poll() is not None:
@ -91,13 +89,9 @@ def _run_validations(upgrade=False):
playbook_args = constants.DEPLOY_ANSIBLE_ACTIONS['preflight-deploy']
with utils.TempDirs() as tmp:
actions = ValidationActions()
args = ['validation', 'run', '-i', 'undercloud', '--validation',
def _check_memory():