From b8c47c8d223f45092325cb8c02fa137eeebefb25 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Mon, 16 Aug 2021 11:09:18 +0530 Subject: [PATCH] mgr/nfs: don't log fsal keys FSAL keys are written to export objects. Don't log it, instead log the initial export before generating keys and user config object mostly will not contain export block. It's okay to log user config object content. Signed-off-by: Varsha Rao --- src/pybind/mgr/nfs/cluster.py | 1 + src/pybind/mgr/nfs/export.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/nfs/cluster.py b/src/pybind/mgr/nfs/cluster.py index 993d046cd68..5a0490023a5 100644 --- a/src/pybind/mgr/nfs/cluster.py +++ b/src/pybind/mgr/nfs/cluster.py @@ -221,6 +221,7 @@ class NFSCluster: return 0, "", "NFS-Ganesha User Config already exists" rados_obj.write_obj(nfs_config, self._get_user_conf_obj_name(cluster_id), self._get_common_conf_obj_name(cluster_id)) + log.debug("Successfully saved %s's user config: \n %s", cluster_id, nfs_config) restart_nfs_service(self.mgr, cluster_id) return 0, "NFS-Ganesha Config Set Successfully", "" raise ClusterNotFound() diff --git a/src/pybind/mgr/nfs/export.py b/src/pybind/mgr/nfs/export.py index 0797160d407..521f7c55b8d 100644 --- a/src/pybind/mgr/nfs/export.py +++ b/src/pybind/mgr/nfs/export.py @@ -65,8 +65,8 @@ class NFSRados: if not config_obj: # Return after creating empty common config object return - log.debug("write configuration into rados object " - f"{self.pool}/{self.namespace}/{obj}:\n{conf_block}") + log.debug("write configuration into rados object %s/%s/%s", + self.pool, self.namespace, obj) # Add created obj url to common config obj ioctx.append(config_obj, GaneshaConfParser.write_block( @@ -78,8 +78,8 @@ class NFSRados: with self.mgr.rados.open_ioctx(self.pool) as ioctx: ioctx.set_namespace(self.namespace) ioctx.write_full(obj, conf_block.encode('utf-8')) - log.debug("write configuration into rados object " - f"{self.pool}/{self.namespace}/{obj}:\n{conf_block}") + log.debug("write configuration into rados object %s/%s/%s", + self.pool, self.namespace, obj) ExportMgr._check_rados_notify(ioctx, config_obj) log.debug(f"Update export {obj} in {config_obj}") @@ -244,8 +244,8 @@ class ExportMgr: raw_config = obj.read(size) raw_config = raw_config.decode("utf-8") log.debug("read export configuration from rados " - "object %s/%s/%s:\n%s", self.rados_pool, - rados_namespace, obj.key, raw_config) + "object %s/%s/%s", self.rados_pool, + rados_namespace, obj.key) self.export_conf_objs.append(Export.from_export_block( GaneshaConfParser(raw_config).parse()[0], rados_namespace)) @@ -570,6 +570,7 @@ class ExportMgr: "clients": clients, } ) + log.debug("creating cephfs export %s", export) self._create_export_user(export) self._save_export(cluster_id, export) result = { @@ -605,6 +606,7 @@ class ExportMgr: "clients": clients, } ) + log.debug("creating rgw export %s", export) self._create_export_user(export) self._save_export(cluster_id, export) result = { -- 2.39.5