From: David Garcia Date: Wed, 5 May 2021 14:51:40 +0000 (+0200) Subject: Minor fix in Keystone charm config X-Git-Tag: release-v10.0-start~17 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F10751%2F4;p=osm%2Fdevops.git Minor fix in Keystone charm config Fix the default value for the config ldap_user_enabled_default in the Keystone charm, used by the charmed installation of OSM Change-Id: I0272c1c7218d999e6d1ad7755883961ace997a81 Signed-off-by: David Garcia --- diff --git a/installers/charm/keystone/config.yaml b/installers/charm/keystone/config.yaml index 2a54a3d9..2758d1c4 100644 --- a/installers/charm/keystone/config.yaml +++ b/installers/charm/keystone/config.yaml @@ -191,7 +191,7 @@ options: enablement. However, some schemas might use an integer value in an attribute. In this situation, set user_enabled_default to the integer value that represents a user being enabled. - default: true + default: "true" ldap_user_enabled_invert: type: boolean description: | diff --git a/installers/charm/keystone/src/charm.py b/installers/charm/keystone/src/charm.py index a8c69fe6..5d8d3174 100755 --- a/installers/charm/keystone/src/charm.py +++ b/installers/charm/keystone/src/charm.py @@ -118,7 +118,7 @@ class ConfigLdapModel(ModelValidator): ldap_user_filter: Optional[str] ldap_user_enabled_attribute: Optional[str] ldap_user_enabled_mask: Optional[int] - ldap_user_enabled_default: Optional[bool] + ldap_user_enabled_default: Optional[str] ldap_user_enabled_invert: Optional[bool] ldap_group_objectclass: Optional[str] ldap_group_tree_dn: Optional[str] @@ -126,6 +126,13 @@ class ConfigLdapModel(ModelValidator): ldap_tls_cacert_base64: Optional[str] ldap_tls_req_cert: Optional[str] + @validator + def validate_ldap_user_enabled_default(cls, v): + if v: + if v not in ["true", "false"]: + raise ValueError('must be equal to "true" or "false"') + return v + class KeystoneCharm(CharmedOsmBase): def __init__(self, *args) -> NoReturn: