]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #32234 from votdev/better_orch_exception
authorTatjana Dehler <tdehler@suse.com>
Thu, 9 Jan 2020 12:41:43 +0000 (13:41 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Jan 2020 12:41:43 +0000 (13:41 +0100)
mgr/dashboard: Throw a more meaningful exception

Reviewed-by: Sebastian Wagner <swagner@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
1  2 
qa/tasks/mgr/dashboard/test_host.py
src/pybind/mgr/dashboard/controllers/orchestrator.py

index bc133d1e2d3a99eb64c76fb57dfff2f37d4c672d,2216a00bd020fc0bc27ea89539ffd120bdf62759..5276d9056698733e1076176c33585580ceffca53
@@@ -83,9 -83,19 +83,23 @@@ class HostControllerTest(DashboardTestC
          self.assertSchema(data, JList(JObj({
              'daemons': JList(str),
              'devid': str,
 -            'location': JList(JObj({'host': str, 'dev': str}))
 +            'location': JList(JObj({
 +                'host': str,
 +                'dev': str,
 +                'path': str
 +            }))
          })))
+ class HostControllerNoOrchestratorTest(DashboardTestCase):
+     def test_host_create(self):
+         self._post('/api/host?hostname=foo')
+         self.assertStatus(503)
+         self.assertError(code='orchestrator_status_unavailable',
+                          component='orchestrator')
+     def test_host_delete(self):
+         self._delete('/api/host/bar')
+         self.assertStatus(503)
+         self.assertError(code='orchestrator_status_unavailable',
+                          component='orchestrator')