stop using distutils in letstest

This commit is contained in:
Brad Warren 2021-11-01 13:45:46 -07:00
parent a1e0f0b4d8
commit 02b6ccfbc0

View file

@ -1,8 +1,9 @@
#!/usr/bin/env python
# Test script for OpenSSL version checking
from distutils.version import LooseVersion
import sys
from certbot import util
def main(openssl_version, apache_version):
if not openssl_version.strip():
@ -12,8 +13,8 @@ def main(openssl_version, apache_version):
conf_file_location = "/etc/letsencrypt/options-ssl-apache.conf"
with open(conf_file_location) as f:
contents = f.read()
if LooseVersion(apache_version.strip()) < LooseVersion('2.4.11') or \
LooseVersion(openssl_version.strip()) < LooseVersion('1.0.2l'):
if util.parse_loose_version(apache_version.strip()) < util.parse_loose_version('2.4.11') or \
util.parse_loose_version(openssl_version.strip()) < util.parse_loose_version('1.0.2l'):
# should be old version
# assert SSLSessionTickets not in conf file
if "SSLSessionTickets" in contents: