From e78569a4cbbf5f7a5ba96de51b1c7dc15874be7c Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Thu, 19 Sep 2019 13:38:42 +0000 Subject: [PATCH] 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 --- .../ceph/cluster/osd/osd-list/osd-list.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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() -- 2.39.5