From e994dabaec9168f1eb77fcb9f317a3b66fb4b617 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Fri, 22 Mar 2019 15:03:15 -0400 Subject: [PATCH] Add uca to ceph_repository choices validation Ubuntu cloud archive is configurable via ceph_repository variable but the uca choice isn't accepted. This commit fixes this issue and also validates the associated uca repository variables. Resolves: #3739 Signed-off-by: Dimitri Savineau (cherry picked from commit 94505a3af264fc0e847e71cbf633dc02ce58e6ff) --- plugins/actions/validate.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/actions/validate.py b/plugins/actions/validate.py index 2e91685a9..79fc9418c 100644 --- a/plugins/actions/validate.py +++ b/plugins/actions/validate.py @@ -60,6 +60,9 @@ class ActionModule(ActionBase): if host_vars["ceph_repository"] == "dev": notario.validate(host_vars, ceph_repository_dev, defined_keys=True) + if host_vars["ceph_repository"] == "uca": + notario.validate(host_vars, ceph_repository_uca, defined_keys=True) + # store these values because one must be defined and the validation method # will need access to all three through the store notario_store["monitor_address"] = host_vars.get("monitor_address", None) @@ -134,7 +137,8 @@ def ceph_origin_choices(value): def ceph_repository_choices(value): - assert value in ['community', 'rhcs', 'dev', 'custom'], "ceph_repository must be either 'community', 'rhcs', 'dev', or 'custom'" + msg = "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom' or 'uca'" + assert value in ['community', 'rhcs', 'dev', 'custom', 'uca'], msg def ceph_repository_type_choices(value): @@ -214,6 +218,12 @@ ceph_repository_dev = ( ("ceph_dev_sha1", types.string), ) +ceph_repository_uca = ( + ("ceph_stable_repo_uca", types.string), + ("ceph_stable_openstack_release_uca", types.string), + ("ceph_stable_release_uca", types.string), +) + monitor_options = ( ("cluster_network", types.string), ("fsid", types.string), -- 2.39.5