MCPcopy Create free account
hub / github.com/ceph/ceph / LocalCephManager

Class LocalCephManager

qa/tasks/vstart_runner.py:811–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

809# XXX: this class has nothing to do with the Ceph daemon (ceph-mgr) of
810# the same name.
811class LocalCephManager(CephManager):
812 def __init__(self, ctx=None, cluster_name=None):
813 self.ctx = ctx
814 self.cluster = cluster_name
815
816 # Deliberately skip parent init, only inheriting from it to get
817 # util methods like osd_dump that sit on top of raw_cluster_cmd
818 self.controller = LocalRemote()
819
820 # A minority of CephManager fns actually bother locking for when
821 # certain teuthology tests want to run tasks in parallel
822 self.lock = threading.RLock()
823
824 self.log = lambda x: log.debug(x)
825
826 # Don't bother constructing a map of pools: it should be empty
827 # at test cluster start, and in any case it would be out of date
828 # in no time. The attribute needs to exist for some of the CephManager
829 # methods to work though.
830 self.pools = {}
831
832 # NOTE: These variables are being overriden here so that parent class
833 # can pick it up.
834 self.cephadm = False
835 self.rook = False
836 self.testdir = None
837 self.RADOS_CMD = [RADOS_CMD]
838
839 self.save_conf_epoch()
840
841 def get_ceph_cmd(self, **kwargs):
842 return [CEPH_CMD]
843
844 def find_remote(self, daemon_type, daemon_id):
845 """
846 daemon_type like 'mds', 'osd'
847 daemon_id like 'a', '0'
848 """
849 return LocalRemote()
850
851 def admin_socket(self, daemon_type, daemon_id, command, check_status=True,
852 timeout=None, stdout=None):
853 if stdout is None:
854 stdout = StringIO()
855
856 args=[CEPH_CMD, "daemon", f"{daemon_type}.{daemon_id}"] + command
857 return self.controller.run(args=args, check_status=check_status,
858 timeout=timeout, stdout=stdout)
859
860
861class LocalCephCluster(tasks.cephfs.filesystem.CephClusterBase):

Callers 4

_init_mon_managerMethod · 0.90
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by 1

_init_mon_managerMethod · 0.72