]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Implement OSD purge 26242/head
authorPatrick Nawracay <pnawracay@suse.com>
Fri, 1 Feb 2019 10:58:22 +0000 (11:58 +0100)
committerPatrick Nawracay <pnawracay@suse.com>
Mon, 18 Feb 2019 07:18:09 +0000 (07:18 +0000)
Removes the `remove` functionality from the UI.

Fixes: http://tracker.ceph.com/issues/35811
Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
qa/tasks/mgr/dashboard/test_osd.py
src/pybind/mgr/dashboard/controllers/osd.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts
src/pybind/mgr/dashboard/frontend/src/locale/messages.xlf

index 453c77485d2ebe3525878cbe6cc244961e5ddec0..c6c7c5aadd6875737c25a2afb6c5e74beeb8c68a 100644 (file)
@@ -93,8 +93,8 @@ class OsdTest(DashboardTestCase):
         # Destroy
         self._post('/api/osd/5/destroy')
         self.assertStatus(200)
-        # Remove
-        self._post('/api/osd/5/remove')
+        # Purge
+        self._post('/api/osd/5/purge')
         self.assertStatus(200)
 
     def test_safe_to_destroy(self):
index 54c6c5560230b1df56246fd42e98096a4c8ed815..24de3b4193d53cc2ed59857f51f98b7668e91d2b 100644 (file)
@@ -141,11 +141,12 @@ class Osd(RESTController):
         }
 
     @RESTController.Resource('POST')
-    def remove(self, svc_id):
+    def purge(self, svc_id):
         """
         Note: osd must be marked `down` before removal.
         """
-        CephService.send_command('mon', 'osd rm', ids=[svc_id])
+        CephService.send_command('mon', 'osd purge-actual', id=int(svc_id),
+                                 yes_i_really_mean_it=True)
 
     @RESTController.Resource('POST')
     def destroy(self, svc_id):
index 7288cee3e26efbe2e08b7aede081b84e2eb7de69..b7e0fca6bf511d6a496f5962253294b05a945ddd 100644 (file)
@@ -181,7 +181,7 @@ describe('OsdListComponent', () => {
       const modalClass = CriticalConfirmationModalComponent;
       mockSafeToDestroy();
       expectOpensModal('Mark Lost', modalClass);
-      expectOpensModal('Remove', modalClass);
+      expectOpensModal('Purge', modalClass);
       expectOpensModal('Destroy', modalClass);
     });
   });
@@ -216,7 +216,7 @@ describe('OsdListComponent', () => {
     it('calls the corresponding service methods in critical confirmation modals', () => {
       mockSafeToDestroy();
       expectOsdServiceMethodCalled('Mark Lost', 'markLost');
-      expectOsdServiceMethodCalled('Remove', 'remove');
+      expectOsdServiceMethodCalled('Purge', 'purge');
       expectOsdServiceMethodCalled('Destroy', 'destroy');
     });
   });
index 261d8e5e13ef96c6c5fe6e60c1f8d71d506482bd..f3ecc673bc0226745f324470c93e2f841e16e94a 100644 (file)
@@ -118,17 +118,17 @@ export class OsdListComponent implements OnInit {
         icon: 'fa-unlink'
       },
       {
-        name: this.i18n('Remove'),
+        name: this.i18n('Purge'),
         permission: 'delete',
         click: () =>
           this.showCriticalConfirmationModal(
-            this.i18n('Remove'),
+            this.i18n('Purge'),
             this.i18n('OSD'),
-            this.i18n('removed'),
-            this.osdService.remove
+            this.i18n('purged'),
+            this.osdService.purge
           ),
         disable: () => this.isNotSelectedOrInState('up'),
-        icon: 'fa-remove'
+        icon: 'fa-eraser'
       },
       {
         name: this.i18n('Destroy'),
@@ -141,7 +141,7 @@ export class OsdListComponent implements OnInit {
             this.osdService.destroy
           ),
         disable: () => this.isNotSelectedOrInState('up'),
-        icon: 'fa-eraser'
+        icon: 'fa-remove'
       }
     ];
   }
index a442642a06bbb7dfea0b67a0bd6ecc88d883e397..e9225ef1359ca5ce83773739a6529ea8789320f2 100644 (file)
@@ -94,9 +94,9 @@ describe('OsdService', () => {
     expect(req.request.method).toBe('POST');
   });
 
-  it('should remove an OSD', () => {
-    service.remove(1).subscribe();
-    const req = httpTesting.expectOne('api/osd/1/remove');
+  it('should purge an OSD', () => {
+    service.purge(1).subscribe();
+    const req = httpTesting.expectOne('api/osd/1/purge');
     expect(req.request.method).toBe('POST');
   });
 
index a98d503ae0f2d28b1f948056c0b2042642e7a383..06c63bf8c0bdaff579bcc2a86bc023d980622f37 100644 (file)
@@ -98,8 +98,8 @@ export class OsdService {
     return this.http.post(`${this.path}/${id}/mark_lost`, null);
   }
 
-  remove(id: number) {
-    return this.http.post(`${this.path}/${id}/remove`, null);
+  purge(id: number) {
+    return this.http.post(`${this.path}/${id}/purge`, null);
   }
 
   destroy(id: number) {
index a6b883cc654ee39ff5b619e6965ad61f0041d3bb..9678d47c7b704aa8513bf6ac8fd48396bdc9569c 100644 (file)
           <context context-type="linenumber">1</context>
         </context-group>
       </trans-unit>
-      <trans-unit id="019d4bd6a5690f0cfa0ecf346a4e6bf7f0d8debb" datatype="html">
-        <source>Remove</source>
+      <trans-unit id="40fedc157ad899a18ec40573f770d18b040959d2" datatype="html">
+        <source>Purge</source>
         <context-group purpose="location">
           <context context-type="sourcefile">src/app/ceph/cluster/osd/osd-list/osd-list.component.ts</context>
           <context context-type="linenumber">1</context>
           <context context-type="linenumber">1</context>
         </context-group>
       </trans-unit>
-      <trans-unit id="c640261f80e6afd42cac3f4b63594012f198e0e8" datatype="html">
-        <source>removed</source>
+      <trans-unit id="4f3cff08c7033b63bbccfe66006b1bcaea48ddd8" datatype="html">
+        <source>purged</source>
         <context-group purpose="location">
           <context context-type="sourcefile">src/app/ceph/cluster/osd/osd-list/osd-list.component.ts</context>
           <context context-type="linenumber">1</context>