From 9627bf480703002f91464fc959903e294473aa8e Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Tue, 22 Dec 2015 16:14:00 +0100 Subject: Use repos_dir env variable in all Functest scripts JIRA: FUNCTEST-90 This way, we remove the 'functest repo' input parameter on the python scripts call and we make it simpler using the available repos_dir env variable which points to /home/opnfv/repos Change-Id: I7d74bf1bc8d89f8f14397fcb9dafc22ee1482f84 Signed-off-by: jose.lausuch --- testcases/config_functest.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'testcases/config_functest.py') diff --git a/testcases/config_functest.py b/testcases/config_functest.py index 1d834bb37..d0788d30f 100755 --- a/testcases/config_functest.py +++ b/testcases/config_functest.py @@ -17,7 +17,6 @@ from neutronclient.v2_0 import client as neutronclient actions = ['start', 'check', 'clean'] parser = argparse.ArgumentParser() -parser.add_argument("repo_path", help="Path to the repository") parser.add_argument("action", help="Possible actions are: '{d[0]}|{d[1]}|{d[2]}' ".format(d=actions)) parser.add_argument("-d", "--debug", help="Debug mode", action="store_true") parser.add_argument("-f", "--force", help="Force", action="store_true") @@ -38,18 +37,19 @@ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(messag ch.setFormatter(formatter) logger.addHandler(ch) -if not os.path.exists(args.repo_path): - logger.error("Repo directory not found '%s'" % args.repo_path) +REPO_PATH=os.environ['repos_dir']+'/functest/' +if not os.path.exists(REPO_PATH): + logger.error("Functest repository directory not found '%s'" % REPO_PATH) exit(-1) +sys.path.append(REPO_PATH + "testcases/") -with open(args.repo_path+"testcases/config_functest.yaml") as f: +with open(REPO_PATH+"testcases/config_functest.yaml") as f: functest_yaml = yaml.safe_load(f) f.close() """ global variables """ # Directories -REPO_PATH = args.repo_path RALLY_DIR = REPO_PATH + functest_yaml.get("general").get("directories").get("dir_rally") RALLY_REPO_DIR = functest_yaml.get("general").get("directories").get("dir_repo_rally") RALLY_INSTALLATION_DIR = functest_yaml.get("general").get("directories").get("dir_rally_inst") @@ -194,9 +194,8 @@ def action_clean(): shutil.rmtree(RALLY_RESULT_DIR,ignore_errors=True) logger.debug("Cleaning up the OpenStack deployment...") - cmd='python ' + args.repo_path + \ - '/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py -d ' \ - +args.repo_path + cmd='python ' + REPO_PATH + \ + '/testcases/VIM/OpenStack/CI/libraries/clean_openstack.py -d ' functest_utils.execute_command(cmd,logger) logger.info("Functest environment clean!") -- cgit 1.2.3-korg