From 2b79ac27535dcbb677ad69437f814dbb9a69faf1 Mon Sep 17 00:00:00 2001 From: "Gael Chamoulaud (Strider)" Date: Wed, 7 Apr 2021 07:15:10 +0200 Subject: [PATCH] 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] https://opendev.org/openstack/python-tripleoclient/commit/8b336981a801857205581029a7668ee0112f8ea5 Authored-By: Mathieu Bultel Signed-off-by: Gael Chamoulaud (Strider) Change-Id: Ieeb0e15533de0eb6fc7ba099cd381182bdb7bc68 (cherry picked from commit 15538634b1ca30639205bbec84ae7b93f501cd44) (cherry picked from commit 2c23e9fa02f95ac006ab7a3026f872fdee979cdf) --- tripleoclient/v1/tripleo_validator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tripleoclient/v1/tripleo_validator.py b/tripleoclient/v1/tripleo_validator.py index 9d996d13a..cced7273f 100644 --- a/tripleoclient/v1/tripleo_validator.py +++ b/tripleoclient/v1/tripleo_validator.py @@ -266,6 +266,13 @@ class TripleOValidatorRun(command.Command): ) ) + parser.add_argument( + '--python-interpreter', + action='store', + default="/usr/libexec/platform-python", + help=_("Python interpreter for Ansible execution. ") + ) + extra_vars_group = parser.add_mutually_exclusive_group(required=False) extra_vars_group.add_argument( @@ -417,6 +424,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)