]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: fix error when trying to get the list of nfs services
authorJuan Miguel Olmo Martínez <jolmomar@redhat.com>
Wed, 18 May 2022 16:18:16 +0000 (18:18 +0200)
committerYuri Weinstein <yweinste@redhat.com>
Mon, 17 Oct 2022 19:46:50 +0000 (19:46 +0000)
Resolves: https://tracker.ceph.com/issues/55605

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
(cherry picked from commit 1532de124a99ab0e0820850e1c2739689ccb09f0)

src/pybind/mgr/rook/module.py

index 4300e98d502b1b39d71cf01de6bfa12a9068afb1..370cb6582199d341cd4b00d2459ace424587f899 100644 (file)
@@ -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: