From: Tiago Melo Date: Thu, 19 Sep 2019 13:38:42 +0000 (+0000) Subject: mgr/dashboard: Fix error when removing osds X-Git-Tag: v15.1.0~1460^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e78569a4cbbf5f7a5ba96de51b1c7dc15874be7c;p=ceph.git mgr/dashboard: Fix error when removing osds 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 --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts index 3605b2d493e..2066258058b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts @@ -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()