From 14abaf1589d49acbac8b29812119c6814044c3ef Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 10 Nov 2021 08:39:46 +0100 Subject: [PATCH 1/4] Revert "opencas.py uses the f-string feature of python3.6+." This reverts commit b533e2cbf9a67e5f3e392f2473675a1da4cfec93. Signed-off-by: Robert Baldyga --- utils/casctl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/casctl b/utils/casctl index 2171e70..f811596 100755 --- a/utils/casctl +++ b/utils/casctl @@ -10,8 +10,8 @@ import sys import opencas -if sys.version_info < (3, 6): - raise RuntimeError('At least Python 3.6 is required') +if sys.version_info < (3, 5): + raise RuntimeError('At least Python 3.5 is required') def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) From 791829a8cec18d932797e544dec1c8a996671c6a Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 10 Nov 2021 08:41:30 +0100 Subject: [PATCH 2/4] Revert "utils: casctl needs python 3.5+" This reverts commit 087dd29560a157dcf59aa18ed688d3f5b5edfd99. Signed-off-by: Robert Baldyga --- utils/casctl | 3 --- 1 file changed, 3 deletions(-) diff --git a/utils/casctl b/utils/casctl index f811596..64a5e38 100755 --- a/utils/casctl +++ b/utils/casctl @@ -10,9 +10,6 @@ import sys import opencas -if sys.version_info < (3, 5): - raise RuntimeError('At least Python 3.5 is required') - def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) From 5bc29d26ca0caab9f465429f38ce949643eed511 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Wed, 10 Nov 2021 08:47:07 +0100 Subject: [PATCH 3/4] casctl: Fix license tag Open CAS Linux and other projects in the Open CAS repo were always intended to be released under the OSI-approved BSD 3-Clause License. Change the license tag to the proper one. Signed-off-by: Robert Baldyga --- utils/casctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/casctl b/utils/casctl index 64a5e38..605fac2 100755 --- a/utils/casctl +++ b/utils/casctl @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # # Copyright(c) 2012-2021 Intel Corporation -# SPDX-License-Identifier: BSD-3-Clause-Clear +# SPDX-License-Identifier: BSD-3-Clause # import argparse From 96e6acc7f1661b87eb761a67d137a713a4dafe65 Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 9 Nov 2021 20:09:51 +0100 Subject: [PATCH 4/4] casctl: Add minimum python version check Signed-off-by: Robert Baldyga --- utils/casctl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/utils/casctl b/utils/casctl index 605fac2..9c74bd2 100755 --- a/utils/casctl +++ b/utils/casctl @@ -4,9 +4,20 @@ # SPDX-License-Identifier: BSD-3-Clause # +from packaging import version +import platform +import sys + +min_ver = version.parse("3.6") +ver = version.parse(platform.python_version()) +if ver < min_ver: + print((f"Minimum required python version is {min_ver}\n" + f"Detected python version is {ver}"), + file = sys.stderr) + exit(1) + import argparse import re -import sys import opencas