From 69bc1abc5bd0131df7df6bbb49653b892be94374 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Wed, 5 May 2021 16:51:40 +0200 Subject: [PATCH] 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 --- installers/charm/keystone/config.yaml | 2 +- installers/charm/keystone/src/charm.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) 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: -- 2.25.1