Skip to content

Commit c06dccf

Browse files
Tim Lanetilne
Tim Lane
authored andcommitted
Print warning when using OSes reaching EOL in 2020
Signed-off-by: Tim Lane <[email protected]>
1 parent 6f31957 commit c06dccf

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Diff for: cli/pcluster/config/mappings.py

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
SpotPriceParam,
3333
)
3434
from pcluster.config.validators import (
35+
base_os_validator,
3536
cluster_validator,
3637
compute_instance_type_validator,
3738
dcv_enabled_validator,
@@ -457,6 +458,7 @@
457458
("base_os", {
458459
"cfn_param_mapping": "BaseOS",
459460
"allowed_values": ["alinux", "alinux2", "ubuntu1604", "ubuntu1804", "centos6", "centos7"],
461+
"validators": [base_os_validator],
460462
"required": True,
461463
}),
462464
("scheduler", {

Diff for: cli/pcluster/config/validators.py

+13
Original file line numberDiff line numberDiff line change
@@ -846,3 +846,16 @@ def intel_hpc_validator(param_key, param_value, pcluster_config):
846846
)
847847

848848
return errors, warnings
849+
850+
851+
def base_os_validator(param_key, param_value, pcluster_config):
852+
warnings = []
853+
854+
eol_2020 = ["centos6", "alinux"]
855+
if param_value in eol_2020:
856+
warnings.append(
857+
"The operating system you are using ({0}) will reach end-of-life in late 2020. It will be deprecated in "
858+
"future releases of ParallelCluster".format(param_value)
859+
)
860+
861+
return [], warnings

Diff for: cli/tests/pcluster/config/test_validators.py

+16
Original file line numberDiff line numberDiff line change
@@ -1195,3 +1195,19 @@ def test_fsx_os_support(mocker, base_os, expected_message):
11951195
}
11961196

11971197
utils.assert_param_validator(mocker, config_parser_dict, re.escape(expected_message) if expected_message else None)
1198+
1199+
1200+
@pytest.mark.parametrize(
1201+
"base_os, expected_warning",
1202+
[
1203+
("alinux2", None),
1204+
("centos7", None),
1205+
("ubuntu1604", None),
1206+
("ubuntu1804", None),
1207+
("centos6", "centos6.*will reach end-of-life in late 2020"),
1208+
("alinux", "alinux.*will reach end-of-life in late 2020"),
1209+
],
1210+
)
1211+
def test_base_os_validator(mocker, capsys, base_os, expected_warning):
1212+
config_parser_dict = {"cluster default": {"base_os": base_os}}
1213+
utils.assert_param_validator(mocker, config_parser_dict, capsys=capsys, expected_warning=expected_warning)

0 commit comments

Comments
 (0)