Make Python Interpreter option for Ansible Validation Run
This patch adds the --python-interpreter argument to the ValidatorRun
subcommand and allows the user to specify their own python interpreter.
Note: This argument was only added in Train by [1] some months ago and
this patch adds it in previous branches.
[1] 8b336981a8
Authored-By: Mathieu Bultel <mbultel@redhat.com>
Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: Ieeb0e15533de0eb6fc7ba099cd381182bdb7bc68
This commit is contained in:
parent
446667a851
commit
15538634b1
|
@ -16,6 +16,7 @@
|
|||
import argparse
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
from openstack import exceptions as os_exceptions
|
||||
|
@ -266,6 +267,13 @@ class TripleOValidatorRun(command.Command):
|
|||
)
|
||||
)
|
||||
|
||||
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(
|
||||
|
@ -417,6 +425,7 @@ class TripleOValidatorRun(command.Command):
|
|||
validations_dir=constants.ANSIBLE_VALIDATION_DIR,
|
||||
validation_name=parsed_args.validation_name,
|
||||
extra_env_vars=extra_env_vars,
|
||||
python_interpreter=parsed_args.python_interpreter,
|
||||
quiet=quiet_mode)
|
||||
except RuntimeError as e:
|
||||
raise exceptions.CommandError(e)
|
||||
|
|
Loading…
Reference in New Issue