]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Fix error when removing osds
authorTiago Melo <tmelo@suse.com>
Thu, 19 Sep 2019 13:38:42 +0000 (13:38 +0000)
committerTiago Melo <tmelo@suse.com>
Fri, 20 Sep 2019 11:48:19 +0000 (11:48 +0000)
After purging or destroying OSDs the details component would stay open and try
to fetch data related to a non existent OSDs.
This would result in error notifications and frontend exceptions.

Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts

index 3605b2d493ef97ecc3ff069719340d7efad5cc41..2066258058be1d898b5e07668ed342a737a1381d 100644 (file)
@@ -132,7 +132,10 @@ export class OsdListComponent implements OnInit {
             this.i18n('Purge'),
             this.i18n('OSD'),
             this.i18n('purged'),
-            this.osdService.purge
+            (id) => {
+              this.selection = new CdTableSelection();
+              return this.osdService.purge(id);
+            }
           ),
         disable: () => this.isNotSelectedOrInState('up'),
         icon: Icons.erase
@@ -145,7 +148,10 @@ export class OsdListComponent implements OnInit {
             this.i18n('destroy'),
             this.i18n('OSD'),
             this.i18n('destroyed'),
-            this.osdService.destroy
+            (id) => {
+              this.selection = new CdTableSelection();
+              return this.osdService.destroy(id);
+            }
           ),
         disable: () => this.isNotSelectedOrInState('up'),
         icon: Icons.destroy
@@ -338,6 +344,7 @@ export class OsdListComponent implements OnInit {
               this.getSelectedIds().map((osd: any) => action.call(this.osdService, osd))
             ).subscribe(
               () => {
+                this.getOsdList();
                 modalRef.hide();
               },
               () => modalRef.hide()