]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix property name in orchestrator status response 37737/head
authorVolker Theile <vtheile@suse.com>
Wed, 21 Oct 2020 12:13:32 +0000 (14:13 +0200)
committerVolker Theile <vtheile@suse.com>
Thu, 29 Oct 2020 13:29:34 +0000 (14:29 +0100)
The response of the 'status' endpoint of the 'orchestrator' controller contains the property 'description' instead of 'message' as this is done by other 'status' endpoints.

Fixes: https://tracker.ceph.com/issues/47926
Signed-off-by: Volker Theile <vtheile@suse.com>
src/pybind/mgr/dashboard/controllers/orchestrator.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/models/orchestrator.interface.ts
src/pybind/mgr/dashboard/openapi.yaml
src/pybind/mgr/dashboard/services/orchestrator.py

index 6b2d9bb4c133ab9130df15ade5d7b7d25d4e67c2..13b4a171a89569bfd91f7443e58239489fc772f9 100644 (file)
@@ -16,7 +16,7 @@ from . import ApiController, ControllerDoc, Endpoint, EndpointDoc, \
 
 STATUS_SCHEMA = {
     "available": (bool, "Orchestrator status"),
-    "description": (str, "Description")
+    "message": (str, "Error message")
 }
 
 
index 8bc8f8c9ad70dd8d4f260a01193893fb89674165..58a6cf1698e7aa9c2df91fdc4587071eadbba80a 100644 (file)
@@ -13,6 +13,7 @@ import { TableActionsComponent } from '../../../../shared/datatable/table-action
 import { CdTableAction } from '../../../../shared/models/cd-table-action';
 import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
 import { OrchestratorFeature } from '../../../../shared/models/orchestrator.enum';
+import { OrchestratorStatus } from '../../../../shared/models/orchestrator.interface';
 import { Permissions } from '../../../../shared/models/permissions';
 import { AuthStorageService } from '../../../../shared/services/auth-storage.service';
 import { SharedModule } from '../../../../shared/shared.module';
@@ -30,7 +31,7 @@ describe('InventoryDevicesComponent', () => {
   };
 
   const mockOrchStatus = (available: boolean, features?: OrchestratorFeature[]) => {
-    const orchStatus = { available: available, description: '', features: {} };
+    const orchStatus: OrchestratorStatus = { available: available, message: '', features: {} };
     if (features) {
       features.forEach((feature: OrchestratorFeature) => {
         orchStatus.features[feature] = { available: true };
index feed4a88271dde3f8962c8df302df7fd4d8d39ac..4eceba8c0cac94cf610dba76cfd5d363eae1b0d9 100644 (file)
@@ -1,6 +1,6 @@
 export interface OrchestratorStatus {
   available: boolean;
-  description: string;
+  message: string;
   features: {
     [feature: string]: {
       available: boolean;
index b4193a30b011f0e235f08226eaeebce6a72f0163..10e84e89c083210b9539049139865b7ef14b4cc1 100644 (file)
@@ -5048,12 +5048,12 @@ paths:
                   available:
                     description: Orchestrator status
                     type: boolean
-                  description:
-                    description: Description
+                  message:
+                    description: Error message
                     type: string
                 required:
                 - available
-                - description
+                - message
                 type: object
           description: OK
         '400':
index 16c038ada6e78c612823b2c7cb7ea035c548e70f..9e7d58a69bf3681490b96772756a0be241af9367 100644 (file)
@@ -23,13 +23,13 @@ class OrchestratorAPI(OrchestratorClientMixin):
 
     def status(self):
         try:
-            status, desc = super(OrchestratorAPI, self).available()
-            logger.info("is orchestrator available: %s, %s", status, desc)
-            return dict(available=status, description=desc)
-        except (RuntimeError, OrchestratorError, ImportError):
+            status, message = super().available()
+            logger.info("is orchestrator available: %s, %s", status, message)
+            return dict(available=status, message=message)
+        except (RuntimeError, OrchestratorError, ImportError) as e:
             return dict(
                 available=False,
-                description='Orchestrator is unavailable for unknown reason')
+                message='Orchestrator is unavailable for unknown reason: {}'.format(str(e)))
 
     def orchestrator_wait(self, completions):
         return self._orchestrator_wait(completions)