From 6fc64d9e03d3e34a55c2792fa2e80c1b9a4b93a0 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 9 Feb 2018 21:41:17 +0100 Subject: Read the env file only if exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8e718e583a5a47a089755c31e623a44732e5ba1e Signed-off-by: Cédric Ollivier --- functest/ci/run_tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'functest/ci') diff --git a/functest/ci/run_tests.py b/functest/ci/run_tests.py index 36b52fd4..8c0b11b1 100644 --- a/functest/ci/run_tests.py +++ b/functest/ci/run_tests.py @@ -96,7 +96,11 @@ class Runner(object): @staticmethod def source_envfile(rc_file=ENV_FILE): """Source the env file passed as arg""" + if not os.path.isfile(rc_file): + LOGGER.debug("No env file %s found", rc_file) + return with open(rc_file, "r") as rcfd: + LOGGER.info("Sourcing env file %s", rc_file) for line in rcfd: var = (line.rstrip('"\n').replace('export ', '').split( "=") if re.search(r'(.*)=(.*)', line) else None) -- cgit 1.2.3-korg