Remove arg.repo_path in run_rally_cert.py 27/6527/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Wed, 13 Jan 2016 13:53:33 +0000 (14:53 +0100)
committerjose.lausuch <jose.lausuch@ericsson.com>
Wed, 13 Jan 2016 13:53:33 +0000 (14:53 +0100)
It is not needed as we have an env variable which
points to the repositories directories

Change-Id: I4c07e6a28a9e31a2794d74182436545fe6561a92
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py

index 082c0cf..a52e7f0 100755 (executable)
@@ -31,7 +31,6 @@ from neutronclient.v2_0 import client as neutronclient
 tests = ['authenticate', 'glance', 'cinder', 'heat', 'keystone',
          'neutron', 'nova', 'quotas', 'requests', 'vm', 'all']
 parser = argparse.ArgumentParser()
-parser.add_argument("repo_path", help="Path to the repository")
 parser.add_argument("test_name",
                     help="Module name to be tested. "
                          "Possible values are : "
@@ -54,9 +53,6 @@ args = parser.parse_args()
 
 client_dict = {}
 
-sys.path.append(args.repo_path + "testcases/")
-import functest_utils
-
 """ logging configuration """
 logger = logging.getLogger("run_rally")
 logger.setLevel(logging.DEBUG)
@@ -72,12 +68,18 @@ formatter = logging.Formatter("%(asctime)s - %(name)s - "
 ch.setFormatter(formatter)
 logger.addHandler(ch)
 
+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/")
+import functest_utils
+
 with open("/home/opnfv/functest/conf/config_functest.yaml") as f:
     functest_yaml = yaml.safe_load(f)
 f.close()
 
 HOME = os.environ['HOME']+"/"
-REPO_PATH = args.repo_path
 ####todo:
 #SCENARIOS_DIR = REPO_PATH + functest_yaml.get("general"). \
 #    get("directories").get("dir_rally_scn")
@@ -115,7 +117,7 @@ def push_results_to_db(payload):
 
     url = TEST_DB + "/results"
     installer = functest_utils.get_installer_type(logger)
-    git_version = functest_utils.get_git_branch(args.repo_path)
+    git_version = functest_utils.get_git_branch(REPO_PATH)
     pod_name = functest_utils.get_pod_name(logger)
     # TODO pod_name hardcoded, info shall come from Jenkins
     params = {"project_name": "functest", "case_name": "Rally",