]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: Add more debug log messages
authorVarsha Rao <varao@redhat.com>
Mon, 16 Aug 2021 05:20:48 +0000 (10:50 +0530)
committerAlfonso Martínez <almartin@redhat.com>
Wed, 3 Nov 2021 11:36:57 +0000 (12:36 +0100)
Fixes: https://tracker.ceph.com/issues/52274
Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit 719e7024682d64da9bb2c22b90725ff311e83860)

src/pybind/mgr/nfs/cluster.py
src/pybind/mgr/nfs/export.py

index ba642e427bb2d0c559d8fc8dc9821c1d767e23f9..4211bc6760c876a588f6c297fd70dff95fa44b60 100644 (file)
@@ -41,6 +41,7 @@ def create_ganesha_pool(mgr: 'MgrModule') -> None:
         mgr.check_mon_command({'prefix': 'osd pool application enable',
                                'pool': POOL_NAME,
                                'app': 'nfs'})
+        log.debug("Successfully created nfs-ganesha pool %s", POOL_NAME)
 
 
 class NFSCluster:
@@ -86,6 +87,7 @@ class NFSCluster:
                                   port=port)
             completion = self.mgr.apply_nfs(spec)
             orchestrator.raise_if_exception(completion)
+        log.debug("Successfully deployed nfs daemons with cluster id %s and placement %s", cluster_id, placement)
 
     def create_empty_rados_obj(self, cluster_id: str) -> None:
         common_conf = self._get_common_conf_obj_name(cluster_id)
@@ -205,6 +207,7 @@ class NFSCluster:
                     r['port'] = i.ports[0]
                     if len(i.ports) > 1:
                         r['monitor_port'] = i.ports[1]
+        log.debug("Successfully fetched %s info: %s", cluster_id, r)
         return r
 
     def show_nfs_cluster_info(self, cluster_id: Optional[str] = None) -> Tuple[int, str, str]:
index 8237c71bf4ad8e8e8fe60d078767774587e43289..6f84e35672011018802ed5368f2ca3a81ddc311a 100644 (file)
@@ -214,6 +214,7 @@ class ExportMgr:
             fsal.cephx_key = self._create_user_key(
                 export.cluster_id, fsal.user_id, export.path, fsal.fs_name, not rw
             )
+            log.debug("Successfully created user %s for cephfs path %s", fsal.user_id, export.path)
 
         elif isinstance(export.fsal, RGWFSAL):
             rgwfsal = cast(RGWFSAL, export.fsal)
@@ -236,6 +237,7 @@ class ExportMgr:
             # FIXME: make this more tolerate of unexpected output?
             rgwfsal.access_key_id = j['keys'][0]['access_key']
             rgwfsal.secret_access_key = j['keys'][0]['secret_key']
+            log.debug("Successfully fetched user %s for RGW path %s", rgwfsal.user_id, export.path)
 
     def _gen_export_id(self, cluster_id: str) -> int:
         exports = sorted([ex.export_id for ex in self.exports[cluster_id]])
@@ -290,6 +292,7 @@ class ExportMgr:
                 self._delete_export_user(export)
                 if not self.exports[cluster_id]:
                     del self.exports[cluster_id]
+                    log.debug("Deleted all exports for cluster %s", cluster_id)
                 return 0, "Successfully deleted export", ""
             return 0, "", "Export does not exist"
         except Exception as e:
@@ -566,6 +569,7 @@ class ExportMgr:
         ex_dict["cluster_id"] = cluster_id
         export = Export.from_dict(ex_id, ex_dict)
         export.validate(self.mgr)
+        log.debug("Successfully created %s export-%s from dict for cluster %s", fsal_type, ex_id, cluster_id)
         return export
 
     def create_cephfs_export(self,
@@ -672,7 +676,8 @@ class ExportMgr:
                 # re-fetch via old pseudo
                 old_export = self._fetch_export(cluster_id, old_export.pseudo)
                 assert old_export
-                self.mgr.log.debug(f"export {old_export.export_id} pseudo {old_export.pseudo} -> {new_export_dict['pseudo']}")
+                log.debug("export %s pseudo %s -> %s",
+                          old_export.export_id, old_export.pseudo, new_export_dict['pseudo'])
 
         new_export = self.create_export_from_dict(
             cluster_id,