Make python interpreter option for ansible validation run
When running validation from a Train Undercloud to a non upgraded Overcloud, the python interpreter needs to be adjust otherwise some validations will failed due to a wrong interpreter. https://bugzilla.redhat.com/show_bug.cgi?id=1873470 Change-Id: Ifb987f81c6236646b83d8ab02af4631368b8ef54 rhbz: #1873470
This commit is contained in:
parent
bd22a7fb1d
commit
8b336981a8
|
@ -16,6 +16,7 @@
|
|||
import argparse
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
from osc_lib import exceptions
|
||||
|
@ -238,6 +239,7 @@ class TripleOValidatorRun(command.Command):
|
|||
" run invocation. For example: --limit \"compute-0,"
|
||||
" compute-1, compute-5\".")
|
||||
)
|
||||
|
||||
parser.add_argument('--playbook',
|
||||
nargs="*",
|
||||
default=None,
|
||||
|
@ -246,6 +248,13 @@ class TripleOValidatorRun(command.Command):
|
|||
"or a list of playbook.")
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--python-interpreter',
|
||||
action='store',
|
||||
default="/usr/bin/python{}".format(sys.version_info[0]),
|
||||
help=_("Python interpreter for Ansible execution. ")
|
||||
)
|
||||
|
||||
extra_vars_group = parser.add_mutually_exclusive_group(required=False)
|
||||
|
||||
extra_vars_group.add_argument(
|
||||
|
@ -341,6 +350,7 @@ class TripleOValidatorRun(command.Command):
|
|||
validations_dir=constants.ANSIBLE_VALIDATION_DIR,
|
||||
validation_name=parsed_args.validation_name,
|
||||
extra_env_vars=parsed_args.extra_env_vars,
|
||||
python_interpreter=parsed_args.python_interpreter,
|
||||
quiet=parsed_args.quiet)
|
||||
|
||||
# Build output
|
||||
|
|
Loading…
Reference in New Issue