plugins/actions/validate.py: allow ceph_repository 'obs' on openSUSE

Allow the use of 'obs' as a valid value for ceph_repository, and validate that
- OS is openSUSE
- ceph_obs_repo is defined

Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
pull/4377/head
Johannes Kastl 2019-08-21 21:54:03 +02:00 committed by Guillaume Abrioux
parent efd38ecc88
commit f6b6f7d5b0
1 changed files with 12 additions and 2 deletions

View File

@ -47,6 +47,7 @@ class ActionModule(ActionBase):
try: try:
notario_store["groups"] = host_vars["groups"] notario_store["groups"] = host_vars["groups"]
notario_store["ansible_distribution"] = host_vars["ansible_distribution"]
notario_store["containerized_deployment"] = host_vars["containerized_deployment"] # noqa E501 notario_store["containerized_deployment"] = host_vars["containerized_deployment"] # noqa E501
notario.validate(host_vars, install_options, defined_keys=True) notario.validate(host_vars, install_options, defined_keys=True)
@ -66,6 +67,10 @@ class ActionModule(ActionBase):
notario.validate( notario.validate(
host_vars, ceph_repository_dev, defined_keys=True) host_vars, ceph_repository_dev, defined_keys=True)
if host_vars["ceph_repository"] == "obs":
notario.validate(
host_vars, ceph_repository_obs, defined_keys=True)
if host_vars["ceph_repository"] == "custom": if host_vars["ceph_repository"] == "custom":
notario.validate(host_vars, ceph_repository_custom, defined_keys=True) notario.validate(host_vars, ceph_repository_custom, defined_keys=True)
@ -172,8 +177,8 @@ def ceph_origin_choices(value):
def ceph_repository_choices(value): def ceph_repository_choices(value):
msg = "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom' or 'uca'" msg = "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom', 'uca' or 'obs'"
assert value in ['community', 'rhcs', 'dev', 'custom', 'uca'], msg assert value in ['community', 'rhcs', 'dev', 'custom', 'uca', 'obs'], msg
def ceph_repository_type_choices(value): def ceph_repository_type_choices(value):
@ -256,6 +261,11 @@ ceph_repository_dev = (
("ceph_dev_sha1", types.string), ("ceph_dev_sha1", types.string),
) )
ceph_repository_obs = (
("ansible_distribution", "openSUSE Leap"),
("ceph_obs_repo", types.string),
)
ceph_repository_custom = ("ceph_custom_repo", types.string) ceph_repository_custom = ("ceph_custom_repo", types.string)
ceph_repository_uca = ( ceph_repository_uca = (