From: Venky Shankar Date: Thu, 10 Oct 2019 07:28:24 +0000 (-0400) Subject: mgr/volumes: cleanup leftovers from earlier purge job implementation X-Git-Tag: v15.1.0~1205^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=45c22bdcea4e23d101e27c748536eecf65dc79e7;p=ceph.git mgr/volumes: cleanup leftovers from earlier purge job implementation ... which was not fully implemented anyway, so just remove the boilerplates. Signed-off-by: Venky Shankar --- diff --git a/src/pybind/mgr/volumes/module.py b/src/pybind/mgr/volumes/module.py index 0e710cfd5fc46..367c024cb7c81 100644 --- a/src/pybind/mgr/volumes/module.py +++ b/src/pybind/mgr/volumes/module.py @@ -1,27 +1,11 @@ -from threading import Event import errno import json -try: - import queue as Queue -except ImportError: - import Queue from mgr_module import MgrModule import orchestrator from .fs.volume import VolumeClient -class PurgeJob(object): - def __init__(self, volume_fscid, subvolume_path): - """ - Purge tasks work in terms of FSCIDs, so that if we process - a task later when a volume was deleted and recreated with - the same name, we can correctly drop the task that was - operating on the original volume. - """ - self.fscid = volume_fscid - self.subvolume_path = subvolume_path - class Module(orchestrator.OrchestratorClientMixin, MgrModule): COMMANDS = [ { @@ -185,28 +169,9 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): def __init__(self, *args, **kwargs): super(Module, self).__init__(*args, **kwargs) - self._initialized = Event() self.vc = VolumeClient(self) - self._background_jobs = Queue.Queue() - - def serve(self): - # TODO: discover any subvolumes pending purge, and enqueue - # them in background_jobs at startup - - # TODO: consume background_jobs - # skip purge jobs if their fscid no longer exists - - # TODO: on volume delete, cancel out any background jobs that - # affect subvolumes within that volume. - - # ... any background init needed? Can get rid of this - # and _initialized if not - self._initialized.set() - def handle_command(self, inbuf, cmd): - self._initialized.wait() - handler_name = "_cmd_" + cmd['prefix'].replace(" ", "_") try: handler = getattr(self, handler_name)