mirror of
https://github.com/certbot/certbot.git
synced 2026-06-05 23:04:39 -04:00
execute certbot version in a different command
This commit is contained in:
parent
9668b7fe09
commit
7c0b13e096
1 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue