From 2cb16d3e2d1a9729ceb23c732641792947eb39c6 Mon Sep 17 00:00:00 2001 From: Mathieu Bultel Date: Mon, 24 Feb 2020 09:46:03 +0100 Subject: [PATCH] Move ansible hosts file as a constant Moving ansible hosts filename as a constant to avoid hardcoded value. Change-Id: I014392650849a7c18c7da85a211a8830c2b66c4f --- tripleoclient/constants.py | 1 + tripleoclient/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index 70d6096b3..7ee3b5cc3 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -30,6 +30,7 @@ UNDERCLOUD_CONF_PATH = os.path.join(UNDERCLOUD_OUTPUT_DIR, "undercloud.conf") OVERCLOUD_NETWORKS_FILE = "network_data.yaml" STANDALONE_NETWORKS_FILE = "/dev/null" UNDERCLOUD_NETWORKS_FILE = "network_data_undercloud.yaml" +ANSIBLE_HOSTS_FILENAME = "hosts.yaml" # The name of the file which holds the plan environment contents PLAN_ENVIRONMENT = 'plan-environment.yaml' diff --git a/tripleoclient/utils.py b/tripleoclient/utils.py index 03047018e..76cdcbfc5 100644 --- a/tripleoclient/utils.py +++ b/tripleoclient/utils.py @@ -320,7 +320,7 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None, return ansible_runner.utils.dump_artifact( inventory, ansible_artifact_path, - 'hosts' + constants.ANSIBLE_HOSTS_FILENAME ) if not playbook_dir: