From 55d763f3f756640fe902cd1a12037e349b8cd976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 11 Oct 2018 18:01:10 +0200 Subject: [PATCH] plugin: validate.py do not check osd_scenario MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit osd_scenario now defaults to lvm and should not be changed. So we don't need to test it. Signed-off-by: Sébastien Han (cherry picked from commit 72211d4a247f7485dc24be05ba0d19aa9b6cb52d) --- plugins/actions/validate.py | 43 +++++++++---------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/plugins/actions/validate.py b/plugins/actions/validate.py index ee04bbd5b..ebedd3ed8 100644 --- a/plugins/actions/validate.py +++ b/plugins/actions/validate.py @@ -93,25 +93,16 @@ class ActionModule(ActionBase): if host_vars["osd_group_name"] in host_vars["group_names"]: notario.validate(host_vars, osd_options, defined_keys=True) notario_store['osd_objectstore'] = host_vars["osd_objectstore"] - if host_vars["osd_scenario"] == "collocated": - if not host_vars.get("osd_auto_discovery", False): - notario.validate( - host_vars, collocated_osd_scenario, defined_keys=True) # noqa E501 - if host_vars["osd_scenario"] == "non-collocated": + if host_vars.get("devices"): notario.validate( - host_vars, non_collocated_osd_scenario, defined_keys=True) # noqa E501 - - if host_vars["osd_scenario"] == "lvm": - if host_vars.get("devices"): - notario.validate( - host_vars, lvm_batch_scenario, defined_keys=True) - elif notario_store['osd_objectstore'] == 'filestore': - notario.validate( - host_vars, lvm_filestore_scenario, defined_keys=True) # noqa E501 - elif notario_store['osd_objectstore'] == 'bluestore': - notario.validate( - host_vars, lvm_bluestore_scenario, defined_keys=True) # noqa E501 + host_vars, lvm_batch_scenario, defined_keys=True) + elif notario_store['osd_objectstore'] == 'filestore': + notario.validate( + host_vars, lvm_filestore_scenario, defined_keys=True) # noqa E501 + elif notario_store['osd_objectstore'] == 'bluestore': + notario.validate( + host_vars, lvm_bluestore_scenario, defined_keys=True) # noqa E501 except Invalid as error: display.vvvv("Notario Failure: %s" % str(error)) @@ -212,11 +203,6 @@ def validate_osd_auto_discovery_bool_value(value): False], "osd_auto_discovery can be set to true/True or false/False (default)" -def validate_osd_scenarios(value): - assert value in ["collocated", "non-collocated", - "lvm"], "osd_scenario must be set to 'collocated', 'non-collocated' or 'lvm'" # noqa E501 - - def validate_objectstore(value): assert value in [ "filestore", "bluestore"], "objectstore must be set to 'filestore' or 'bluestore'" # noqa E501 @@ -289,17 +275,8 @@ rados_options = ( ) osd_options = ( - (optional("dmcrypt"), validate_dmcrypt_bool_value), - (optional("osd_auto_discovery"), validate_osd_auto_discovery_bool_value), - ("osd_scenario", validate_osd_scenarios), -) - -collocated_osd_scenario = ("devices", iterables.AllItems(types.string)) - -non_collocated_osd_scenario = ( - (optional("bluestore_wal_devices"), iterables.AllItems(types.string)), - (optional("dedicated_devices"), iterables.AllItems(types.string)), - ("devices", iterables.AllItems(types.string)), + (optional("dmcrypt"), types.boolean), + (optional("osd_auto_discovery"), types.boolean), ) lvm_batch_scenario = ("devices", iterables.AllItems(types.string))