]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: rebase patch
authorPaul Cuzner <pcuzner@redhat.com>
Wed, 23 Dec 2020 04:04:50 +0000 (17:04 +1300)
committerPaul Cuzner <pcuzner@redhat.com>
Tue, 2 Feb 2021 22:47:49 +0000 (11:47 +1300)
Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/orchestrator/_interface.py
src/pybind/mgr/orchestrator/module.py

index a6ffdb4a037be383e43f5b8c03f58502757cfc60..afd0292c45da2283b2c0276b84b0363bec7d1a49 100644 (file)
@@ -529,6 +529,12 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
                     # start the process
                     self._kick_serve_loop()
 
+    def is_paused(self) -> bool:
+        return self.paused
+
+    def worker_pool_size(self) -> int:
+        return self._worker_pool._processes  # type: ignore
+
     def pause(self) -> None:
         if not self.paused:
             self.log.info('Paused')
index 6034e219daf0b8887e8f715a9164c8b5a0e1d600..b7444c04aaa1adbce0d0933c187a1517e8b43386 100644 (file)
@@ -786,6 +786,12 @@ class Orchestrator(object):
     def resume(self) -> None:
         raise NotImplementedError()
 
+    def is_paused(self) -> bool:
+        raise NotImplementedError()
+
+    def worker_pool_size(self) -> int:
+        raise NotImplementedError()
+
     def add_host(self, host_spec: HostSpec) -> Completion[str]:
         """
         Add a host to the orchestrator inventory.
index 534da49bde458cf1d7e02184b92fd8334ac8a362..c33d00a3a57e63c29d0ba1ffc378f4a725e43d80 100644 (file)
@@ -1351,8 +1351,17 @@ Usage:
 
         avail, why = self.available()
         result: Dict[str, Any] = {
-            "backend": o
+            "backend": o,
+            "paused": self.is_paused(),
         }
+
+        try:
+            num_workers = self.worker_pool_size()
+        except NotImplementedError:
+            pass
+        else:
+            result['workers'] = num_workers
+
         if avail is not None:
             result['available'] = avail
             if not avail:
@@ -1366,6 +1375,9 @@ Usage:
                 output += "\nAvailable: {0}".format(result['available'])
                 if 'reason' in result:
                     output += ' ({0})'.format(result['reason'])
+            output += f"\nPaused: {'Yes' if result['paused'] else 'No'}"
+            if 'workers' in result:
+                output += f"\nHost Parallelism: {result['workers']}"
         return HandleCommandResult(stdout=output)
 
     def self_test(self) -> None: