fix typos

This commit is contained in:
Brad Warren 2021-10-29 14:41:58 -07:00
parent 3c4f67d198
commit 0e7fecc4ba
3 changed files with 9 additions and 7 deletions

View file

@ -45,7 +45,7 @@ def get_configurator():
override_class = None
# Special case for older Fedora versions
min_version = util.parse_loose_version('29'()
min_version = util.parse_loose_version('29')
if os_name == 'fedora' and util.parse_loose_version(os_version) < min_version:
os_name = 'fedora_old'

View file

@ -143,7 +143,7 @@ class NginxConfigurator(common.Installer, interfaces.Authenticator):
use_tls13 = self.version >= (1, 13, 0)
min_openssl_version = util.parse_loose_version('1.0.2l')
session_tix_off = self.version >= (1, 5, 9) and self.openssl_version and\
util.parse_loose_version(self.openssl_version) >= LooseVersion('1.0.2l'):
util.parse_loose_version(self.openssl_version) >= min_openssl_version
if use_tls13:
if session_tix_off:

View file

@ -14,6 +14,7 @@ import subprocess
import sys
from typing import Dict
from typing import IO
from typing import List
from typing import Text
from typing import Tuple
from typing import Union
@ -640,21 +641,22 @@ def atexit_register(func, *args, **kwargs):
def parse_loose_version(version_string):
"""Parses a version string into a tuple.
"""Parses a version string into its components.
This code and the returned tuple is based on the now deprecated
distutils.version.LooseVersion class from the Python standard library.
Two LooseVersion classes and two tuples as returned by this function should
Two LooseVersion classes and two lists as returned by this function should
compare in the same way. See
https://github.com/python/cpython/blob/v3.10.0/Lib/distutils/version.py#L205-L347.
:param str version_string: version string
:returns: tuple of parsed version string components
:rtype: tuple
:returns: list of parsed version string components
:rtype: list
"""
components = [x for x in _VERSION_COMPONENT_RE.split(vstring)
components: List[Union[int, str]]
components = [x for x in _VERSION_COMPONENT_RE.split(version_string)
if x and x != '.']
for i, obj in enumerate(components):
try: