]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
radosgw_user: parse system and admin as boolean
authorSeena Fallah <seenafallah@gmail.com>
Sat, 16 Mar 2024 15:15:13 +0000 (16:15 +0100)
committerSeena Fallah <seenafallah@gmail.com>
Sun, 17 Mar 2024 00:20:52 +0000 (01:20 +0100)
The returned payload from rgw has them as a boolean. By having them as a string it would always report a change and try to modify the user.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit a95726c40900d30bb3728fc99e7487c65ea2d0a1)

library/radosgw_user.py

index 8e26bbb3bb0e62ed9b1558f9252fa4f591996742..fddbf893b9c04a0c5f0f35a0e995918b78702ae9 100644 (file)
@@ -415,8 +415,8 @@ def run_module():
     email = module.params.get('email')
     access_key = module.params.get('access_key')
     secret_key = module.params.get('secret_key')
-    system = str(module.params.get('system')).lower()
-    admin = str(module.params.get('admin')).lower()
+    system = module.params.get('system')
+    admin = module.params.get('admin')
 
     if module.check_mode:
         module.exit_json(
@@ -441,8 +441,8 @@ def run_module():
             user = json.loads(out)
             current = {
                 'display_name': user['display_name'],
-                'system': user.get('system', 'false'),
-                'admin': user.get('admin', 'false')
+                'system': user.get('system', False),
+                'admin': user.get('admin', False)
             }
             asked = {
                 'display_name': display_name,