From: Sachin Prabhu Date: Mon, 18 Aug 2025 17:17:58 +0000 (+0100) Subject: mgr/smb: use lazy_init to create the rados store X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4fc592eb64cce763f155d485330ea7cc342b3eb7;p=ceph.git mgr/smb: use lazy_init to create the rados store The rados store is created when the service is deployed. Also fix a typo identified in _lazy_init() Signed-off-by: Sachin Prabhu --- diff --git a/src/pybind/mgr/smb/clustermeta.py b/src/pybind/mgr/smb/clustermeta.py index 72949c5d905..dd412e0f3d8 100644 --- a/src/pybind/mgr/smb/clustermeta.py +++ b/src/pybind/mgr/smb/clustermeta.py @@ -179,7 +179,7 @@ _LOCK_NAME = "cluster_meta" def rados_object(mgr: 'MgrModule', uri: str) -> Iterator[ClusterMeta]: """Return a cluster meta object that will store persistent data in rados.""" pool, ns, objname = rados_store.parse_uri(uri) - store = rados_store.RADOSConfigStore.init(mgr, pool) + store = rados_store.RADOSConfigStore.lazy_init(mgr, pool) cmeta = ClusterMeta() previous = {} diff --git a/src/pybind/mgr/smb/module.py b/src/pybind/mgr/smb/module.py index b368268c188..ac076b559fd 100644 --- a/src/pybind/mgr/smb/module.py +++ b/src/pybind/mgr/smb/module.py @@ -71,7 +71,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): self._priv_store = priv_store or mon_store.MonKeyConfigStore(self) # self._public_store = public_store or mon_store.MonKeyConfigStore(self) self._public_store = ( - public_store or rados_store.RADOSConfigStore.init(self) + public_store or rados_store.RADOSConfigStore.lazy_init(self) ) path_resolver = path_resolver or fs.CachingCephFSPathResolver(self) earmark_resolver = earmark_resolver or CephFSEarmarkResolver(self) diff --git a/src/pybind/mgr/smb/rados_store.py b/src/pybind/mgr/smb/rados_store.py index 9ac99645a65..d3da535dbdb 100644 --- a/src/pybind/mgr/smb/rados_store.py +++ b/src/pybind/mgr/smb/rados_store.py @@ -210,7 +210,7 @@ class RADOSConfigStore: def _lazy_init(self) -> None: if self._init_cb: - self._init_cb + self._init_cb() self._init_cb = None def __getitem__(self, key: EntryKey) -> RADOSConfigEntry: