]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/vstart_runner: set LocalCephManager.cluster 54946/head
authorRishabh Dave <ridave@redhat.com>
Mon, 24 Jan 2022 18:46:32 +0000 (00:16 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 11 Apr 2024 17:09:27 +0000 (22:39 +0530)
Use LocalContext instance to set LocalCephManager.cluster.

Fixes: https://tracker.ceph.com/issues/53601
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit d9fbf65f77ea69355a0f2aeeb8ee6e6d95a14a26)

qa/tasks/vstart_runner.py

index aafe631ed4056b8b18f2bd4e744d398045ab386b..09fa2ae09f64ddd95a39380ec552f866da5b211f 100644 (file)
@@ -773,7 +773,11 @@ class LocalFuseMount(LocalCephFSMount, FuseMount):
 # XXX: this class has nothing to do with the Ceph daemon (ceph-mgr) of
 # the same name.
 class LocalCephManager(CephManager):
-    def __init__(self):
+    def __init__(self, ctx=None):
+        self.ctx = ctx
+        if self.ctx:
+            self.cluster = self.ctx.config['cluster']
+
         # Deliberately skip parent init, only inheriting from it to get
         # util methods like osd_dump that sit on top of raw_cluster_cmd
         self.controller = LocalRemote()
@@ -829,7 +833,7 @@ class LocalCephCluster(CephCluster):
     def __init__(self, ctx):
         # Deliberately skip calling CephCluster constructor
         self._ctx = ctx
-        self.mon_manager = LocalCephManager()
+        self.mon_manager = LocalCephManager(ctx=self._ctx)
         self._conf = defaultdict(dict)
 
     @property
@@ -949,7 +953,7 @@ class LocalFilesystem(LocalMDSCluster, Filesystem):
         self.fs_config = fs_config
         self.ec_profile = fs_config.get('ec_profile')
 
-        self.mon_manager = LocalCephManager()
+        self.mon_manager = LocalCephManager(ctx=self._ctx)
 
         self.client_remote = LocalRemote()
 
@@ -1003,7 +1007,7 @@ class LocalContext(object):
         self.daemons = DaemonGroup()
         if not hasattr(self, 'managers'):
             self.managers = {}
-        self.managers[self.config['cluster']] = LocalCephManager()
+        self.managers[self.config['cluster']] = LocalCephManager(ctx=self)
 
         # Shove some LocalDaemons into the ctx.daemons DaemonGroup instance so that any
         # tests that want to look these up via ctx can do so.