From 51e8a6d5b2b3315a837dd6a3731aa0291a05c704 Mon Sep 17 00:00:00 2001 From: Chandan Kumnar Date: Fri, 27 Jan 2017 16:03:21 +0530 Subject: [PATCH] Fixed discover-config-tempest to read default-overrides.conf from tempest-workspace/etc * As tempest init dumpes all the config files in tempest-workspace/etc. so discover-config-tempest should read the default-overrides.conf from there otherwise user needs to pass an argument --deployer-input file. * Remove python shebang from config-tempest.py Fixes: https://github.com/redhat-openstack/python-tempestconf/issues/4 Change-Id: I68eb6e57f0b14da78e2d70a86aca106b2a34aebe --- config_tempest/config_tempest.py | 10 +++++----- setup.cfg | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config_tempest/config_tempest.py b/config_tempest/config_tempest.py index 9b6a776c..79ffc7de 100755 --- a/config_tempest/config_tempest.py +++ b/config_tempest/config_tempest.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python - -# Copyright 2014 Red Hat, Inc. +# Copyright 2016 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -61,9 +59,11 @@ from tempest.lib.services.network import networks_client LOG = logging.getLogger(__name__) LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' -TEMPEST_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +# Get the current tempest workspace path +TEMPEST_WORKSPACE = os.getcwd() -DEFAULTS_FILE = os.path.join(TEMPEST_DIR, "etc", "default-overrides.conf") +DEFAULTS_FILE = os.path.join(TEMPEST_WORKSPACE, "etc", + "default-overrides.conf") DEFAULT_IMAGE = ("http://download.cirros-cloud.net/0.3.4/" "cirros-0.3.4-x86_64-disk.img") DEFAULT_IMAGE_FORMAT = 'qcow2' diff --git a/setup.cfg b/setup.cfg index b211dff3..45de486a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ data_files = [entry_points] console_scripts = - discover-tempest-config = config_tempest.config_tempest:main + discover-tempest-config = config_tempest.config_tempest:main [build_sphinx] source-dir = doc/source