From 28807ec28bea0b96c8c9c681b8dbbaa9f71f547e Mon Sep 17 00:00:00 2001 From: Dardo D Kleiner Date: Wed, 15 Aug 2018 08:50:19 -0400 Subject: [PATCH] mgr: improve/fix disabled modules check Follow up on 36942af6983d60666f3f8a1a06b352a440a6c0da "disabled_modules" is always a list, it's the items in the list that can be dicts in mimic. Many ways to fix this, here's one. Signed-off-by: Dardo D Kleiner (cherry picked from commit f6519e4003404e10ae1f5e86298cffd4405591da) --- roles/ceph-mgr/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/ceph-mgr/tasks/main.yml b/roles/ceph-mgr/tasks/main.yml index 4e6037695..e247c2b60 100644 --- a/roles/ceph-mgr/tasks/main.yml +++ b/roles/ceph-mgr/tasks/main.yml @@ -28,7 +28,7 @@ - name: set _disabled_ceph_mgr_modules fact set_fact: - _disabled_ceph_mgr_modules: "{% if _ceph_mgr_modules | type_debug == 'list' %}[]{% elif _ceph_mgr_modules.disabled_modules | type_debug == 'dict' %}{{ _ceph_mgr_modules['disabled_modules'] }}{% else %}{{ _ceph_mgr_modules['disabled_modules'] | map(attribute='name') | list }}{% endif %}" + _disabled_ceph_mgr_modules: "{% if _ceph_mgr_modules.disabled_modules | length == 0 %}[]{% elif _ceph_mgr_modules.disabled_modules[0] | type_debug != 'dict' %}{{ _ceph_mgr_modules['disabled_modules'] }}{% else %}{{ _ceph_mgr_modules['disabled_modules'] | map(attribute='name') | list }}{% endif %}" when: - ceph_release_num[ceph_release] >= ceph_release_num['luminous'] -- 2.47.3