From 7c0b13e096ff0565f5154d6bb5510dfb9e71e100 Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Mon, 26 Aug 2019 14:56:33 -0700 Subject: [PATCH] execute certbot version in a different command --- certbot-ci/certbot_integration_tests/utils/misc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/certbot-ci/certbot_integration_tests/utils/misc.py b/certbot-ci/certbot_integration_tests/utils/misc.py index c7d92a4e6..fad978408 100644 --- a/certbot-ci/certbot_integration_tests/utils/misc.py +++ b/certbot-ci/certbot_integration_tests/utils/misc.py @@ -214,8 +214,12 @@ def get_certbot_version(): Find the version of the certbot available in PATH. :return str: the certbot version """ + workspace = os.environ.get('WORKSPACE', os.path.join(os.getcwd(), '.certbot_test_workspace')) + if not os.path.exists(workspace): + os.mkdir(workspace) output = subprocess.check_output(['certbot', '--version'], - universal_newlines=True, stderr=subprocess.STDOUT) + universal_newlines=True, stderr=subprocess.STDOUT, + cwd=workspace) # Typical response is: output = 'certbot 0.31.0.dev0' version_str = output.split(' ')[1].strip() return LooseVersion(version_str)