[bin/cdist] Fix Python version check

This commit is contained in:
Dennis Camera 2021-04-17 09:57:10 +02:00
parent 9ec01d9f97
commit 1c047353a9
2 changed files with 6 additions and 4 deletions

View file

@ -72,9 +72,11 @@ def commandline():
if __name__ == "__main__":
if sys.version < cdist.MIN_SUPPORTED_PYTHON_VERSION:
print('Python >= {} is required on the source host.'.format(
cdist.MIN_SUPPORTED_PYTHON_VERSIO), file=sys.stderr)
if sys.version_info[:3] < cdist.MIN_SUPPORTED_PYTHON_VERSION:
print(
'Python >= {} is required on the source host.'.format(
".".join(map(str, cdist.MIN_SUPPORTED_PYTHON_VERSION))),
file=sys.stderr)
sys.exit(1)
exit_code = 0

View file

@ -64,7 +64,7 @@ REMOTE_EXEC = "ssh -o User=root"
REMOTE_CMDS_CLEANUP_PATTERN = "ssh -o User=root -O exit -S {}"
MIN_SUPPORTED_PYTHON_VERSION = '3.5'
MIN_SUPPORTED_PYTHON_VERSION = (3, 5)
class Error(Exception):