add validations logs path cache
This commit is contained in:
parent
0c8ea35843
commit
582d31dacf
@ -20,6 +20,7 @@ import os
|
||||
import six
|
||||
import sys
|
||||
import tempfile
|
||||
import uuid
|
||||
import yaml
|
||||
|
||||
from six.moves import configparser
|
||||
@ -297,7 +298,8 @@ class Ansible(object):
|
||||
|
||||
command_path = None
|
||||
|
||||
with utils.TempDirs(chdir=False) as ansible_artifact_path:
|
||||
with utils.TempDirs(dir_path=constants.VALIDATION_RUN_LOG_PATH,
|
||||
chdir=False,) as ansible_artifact_path:
|
||||
if 'ANSIBLE_CONFIG' not in env and not ansible_cfg:
|
||||
ansible_cfg = os.path.join(ansible_artifact_path, 'ansible.cfg')
|
||||
config = configparser.ConfigParser()
|
||||
|
@ -12,8 +12,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
|
||||
DEFAULT_VALIDATIONS_BASEDIR = '/usr/share/validations-common'
|
||||
|
||||
ANSIBLE_VALIDATION_DIR = '/usr/share/validations-common/playbooks'
|
||||
@ -23,3 +21,5 @@ VALIDATION_GROUPS_INFO = '%s/groups.yaml' % DEFAULT_VALIDATIONS_BASEDIR
|
||||
VALIDATION_GROUPS = ['no-op',
|
||||
'prep',
|
||||
'post']
|
||||
|
||||
VALIDATION_RUN_LOG_PATH = '/var/lib/validations/logs'
|
||||
|
@ -32,7 +32,7 @@ class Run(object):
|
||||
def run_validations(self, playbook, inventory,
|
||||
group=None, extra_vars=None, validations_dir=None,
|
||||
validation_name=None, extra_env_var=None,
|
||||
ansible_cfg=None):
|
||||
ansible_cfg=None, quiet=True):
|
||||
|
||||
self.log = logging.getLogger(__name__ + ".run_validations")
|
||||
|
||||
@ -71,7 +71,7 @@ class Run(object):
|
||||
parallel_run=True,
|
||||
inventory=inventory,
|
||||
output_callback='validation_json',
|
||||
quiet=True,
|
||||
quiet=quiet,
|
||||
extra_vars=extra_vars,
|
||||
extra_env_variables=extra_env_var,
|
||||
ansible_cfg=ansible_cfg,
|
||||
|
Loading…
x
Reference in New Issue
Block a user