Merge branch 'fix/py-version-check' into 'master'

Fix Python version check

See merge request ungleich-public/cdist!991
This commit is contained in:
poljakowski 2021-04-19 07:02:15 +02:00
commit 2f05467358
2 changed files with 6 additions and 4 deletions

View file

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