From 1cf12cc396809c4a1a30ae0a90f6b55f69e36d2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juan=20Miguel=20Olmo=20Mart=C3=ADnez?= Date: Wed, 18 May 2022 18:18:16 +0200 Subject: [PATCH] mgr/rook: fix error when trying to get the list of nfs services MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Resolves: https://tracker.ceph.com/issues/55605 Signed-off-by: Juan Miguel Olmo Martínez (cherry picked from commit 1532de124a99ab0e0820850e1c2739689ccb09f0) --- src/pybind/mgr/rook/module.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 4300e98d502b..370cb6582199 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -351,8 +351,10 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): all_nfs = self.rook_cluster.get_resource("cephnfses") nfs_pods = self.rook_cluster.describe_pods('nfs', None, None) for nfs in all_nfs: - if nfs['spec']['rados']['pool'] != NFS_POOL_NAME: - continue + # Starting with V.17.2.0, the 'rados' spec part in 'cephnfs' resources does not contain the 'pool' item + if 'pool' in nfs['spec']['rados']: + if nfs['spec']['rados']['pool'] != NFS_POOL_NAME: + continue nfs_name = nfs['metadata']['name'] svc = 'nfs.' + nfs_name if svc in spec: -- 2.47.3