Use validation framework for running undercloud checkdisk

The validations playbook is own and moved under the VF
ansible dir.
The undercloud preflight check should use VF for running it.

Change-Id: Id853b1e80d690734ac9c32a1b914e49608f6cc43
(cherry picked from commit 3dd2c83883)
(cherry picked from commit 8c7942ed25)
This commit is contained in:
Mathieu Bultel 2020-09-23 16:33:06 +02:00 committed by mbu
parent 1a64962d0b
commit 429169bde6
1 changed files with 13 additions and 9 deletions

View File

@ -30,6 +30,9 @@ from oslo_config import cfg
from tripleoclient import constants
from tripleoclient import utils
from validations_libs import constants as v_consts
from validations_libs.validation_actions import ValidationActions
class FailedValidation(Exception):
pass
@ -90,15 +93,16 @@ def _check_diskspace(upgrade=False):
else:
playbook = 'undercloud-disk-space.yaml'
python_interpreter = "/usr/bin/python{}".format(sys.version_info[0])
utils.run_ansible_playbook(logger=LOG,
workdir=constants.ANSIBLE_VALIDATION_DIR,
playbook=playbook,
inventory='undercloud,',
retries=False,
connection='local',
output_callback='validation_output',
python_interpreter=python_interpreter)
with utils.TempDirs() as tmp:
# @matbu: todo: removed this when [1] will be merged
# [1] https://review.opendev.org/753845
v_consts.VALIDATION_ANSIBLE_ARTIFACT_PATH = "{}/artifacts".format(tmp)
actions = ValidationActions()
actions.run_validations(
inventory='undercloud',
log_path=tmp,
validations_dir=constants.ANSIBLE_VALIDATION_DIR,
validation_name=playbook)
def _check_memory():