Browse Source

fix nits

changes/53/712253/1
Mathieu Bultel 2 years ago
parent
commit
0a71d73e4e
  1. 10
      validations_libs/run.py
  2. 5
      validations_libs/utils.py

10
validations_libs/run.py

@ -18,7 +18,6 @@ import logging
import os
import six
from concurrent.futures import ThreadPoolExecutor
from validations_libs.ansible import Ansible as v_ansible
from validations_libs import utils as v_utils
@ -43,7 +42,7 @@ class Run(object):
self.log.debug('Getting the validations list by group')
try:
validations = v_utils.parse_all_validations_on_disk(
(self.validations_dir if validations_dir
(validations_dir if validations_dir
else constants.ANSIBLE_VALIDATION_DIR), group)
for val in validations:
playbooks.append(val.get('id') + '.yaml')
@ -67,8 +66,11 @@ class Run(object):
_playbook, _rc, _status = run_ansible.run(
workdir=tmp,
playbook=playbook,
playbook_dir=constants.
ANSIBLE_VALIDATION_DIR,
playbook_dir=(
validations_dir if
validations_dir else
constants.
ANSIBLE_VALIDATION_DIR),
parallel_run=True,
inventory=inventory,
output_callback='validation_json',

5
validations_libs/utils.py

@ -63,7 +63,7 @@ class Pushd(object):
class TempDirs(object):
"""Simple context manager to manage temp directories."""
def __init__(self, dir_path=None, dir_prefix='tripleo', cleanup=True,
def __init__(self, dir_path=None, dir_prefix='validations', cleanup=True,
chdir=True):
"""This context manager will create, push, and cleanup temp directories.
@ -118,7 +118,8 @@ class TempDirs(object):
if self.cleanup:
self.clean()
else:
LOG.warning("Not cleaning temporary directory [ %s ]" % self.dir)
LOG.warning("Not cleaning temporary directory "
"[ %s ]" % self.dir)
def clean(self):
shutil.rmtree(self.dir, ignore_errors=True)

Loading…
Cancel
Save