try passing workspace through instead

This commit is contained in:
Erica Portnoy 2019-08-26 15:35:56 -07:00
parent 714098e3c5
commit c4be7c428c
2 changed files with 2 additions and 5 deletions

View file

@ -39,7 +39,7 @@ def _prepare_args_env(certbot_args, directory_url, http_01_port, tls_alpn_01_por
new_environ['TMPDIR'] = workspace
additional_args = []
if misc.get_certbot_version() >= LooseVersion('0.30.0'):
if misc.get_certbot_version(workspace) >= LooseVersion('0.30.0'):
additional_args.append('--no-random-sleep-on-renew')
if force_renew:

View file

@ -209,14 +209,11 @@ shutil.rmtree(well_known)
shutil.rmtree(tempdir)
def get_certbot_version():
def get_certbot_version(workspace):
"""
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,
cwd=workspace)