Check for suitable python version

This commit is contained in:
Jamie Cameron
2017-09-25 16:54:13 -07:00
parent 65779cba4a
commit a79e360346
2 changed files with 11 additions and 0 deletions

View File

@@ -1115,6 +1115,8 @@ letsencrypt_title=Let's Encrypt Certificate Request
letsencrypt_err=Failed to request certificate
letsencrypt_ecmds=Neither the Let's Encrypt client command <tt>letsencrypt-auto</tt> or the <tt>python</tt> command were found on your system
letsencrypt_epythonmod=The Python module $1 needed by the built-in Let's Encrypt client is not installed
letsencrypt_epythonver=Failed to get the Python version : $1
letsencrypt_epythonver2=Python version $1 or above is required, but you only have version $2.
letsencrypt_edroot=The Apache virtual host $1 has no document directory!
letsencrypt_edom=Missing or invalid domain name
letsencrypt_erenew=Missing or non-numeric renewal interval

View File

@@ -39,6 +39,15 @@ my $out = &backquote_command("$python -c 'import argparse' 2>&1");
if ($?) {
return &text('letsencrypt_epythonmod', 'argparse');
}
my $ver = &backquote_command("$python --version 2>&1");
if ($ver !~ /Python\s+([0-9\.]+)/) {
return &text('letsencrypt_epythonver',
"<tt>".&html_escape($out)."</tt>");
}
$ver = $1;
if ($ver < 2.5) {
return &text('letsencrypt_epythonver2', '2.5', $ver);
}
return undef;
}