fix nits
This commit is contained in:
parent
805b99d3e2
commit
0a71d73e4e
|
@ -18,7 +18,6 @@ import logging
|
||||||
import os
|
import os
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
|
||||||
from validations_libs.ansible import Ansible as v_ansible
|
from validations_libs.ansible import Ansible as v_ansible
|
||||||
from validations_libs import utils as v_utils
|
from validations_libs import utils as v_utils
|
||||||
|
|
||||||
|
@ -43,7 +42,7 @@ class Run(object):
|
||||||
self.log.debug('Getting the validations list by group')
|
self.log.debug('Getting the validations list by group')
|
||||||
try:
|
try:
|
||||||
validations = v_utils.parse_all_validations_on_disk(
|
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)
|
else constants.ANSIBLE_VALIDATION_DIR), group)
|
||||||
for val in validations:
|
for val in validations:
|
||||||
playbooks.append(val.get('id') + '.yaml')
|
playbooks.append(val.get('id') + '.yaml')
|
||||||
|
@ -67,8 +66,11 @@ class Run(object):
|
||||||
_playbook, _rc, _status = run_ansible.run(
|
_playbook, _rc, _status = run_ansible.run(
|
||||||
workdir=tmp,
|
workdir=tmp,
|
||||||
playbook=playbook,
|
playbook=playbook,
|
||||||
playbook_dir=constants.
|
playbook_dir=(
|
||||||
ANSIBLE_VALIDATION_DIR,
|
validations_dir if
|
||||||
|
validations_dir else
|
||||||
|
constants.
|
||||||
|
ANSIBLE_VALIDATION_DIR),
|
||||||
parallel_run=True,
|
parallel_run=True,
|
||||||
inventory=inventory,
|
inventory=inventory,
|
||||||
output_callback='validation_json',
|
output_callback='validation_json',
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Pushd(object):
|
||||||
class TempDirs(object):
|
class TempDirs(object):
|
||||||
"""Simple context manager to manage temp directories."""
|
"""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):
|
chdir=True):
|
||||||
"""This context manager will create, push, and cleanup temp directories.
|
"""This context manager will create, push, and cleanup temp directories.
|
||||||
|
|
||||||
|
@ -118,7 +118,8 @@ class TempDirs(object):
|
||||||
if self.cleanup:
|
if self.cleanup:
|
||||||
self.clean()
|
self.clean()
|
||||||
else:
|
else:
|
||||||
LOG.warning("Not cleaning temporary directory [ %s ]" % self.dir)
|
LOG.warning("Not cleaning temporary directory "
|
||||||
|
"[ %s ]" % self.dir)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
shutil.rmtree(self.dir, ignore_errors=True)
|
shutil.rmtree(self.dir, ignore_errors=True)
|
||||||
|
|
Loading…
Reference in New Issue