From: Jos Collin Date: Mon, 20 Feb 2023 06:11:53 +0000 (+0530) Subject: cephfs-top: navigate to home screen when no fs X-Git-Tag: v17.2.7~317^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b2db8f949a1dcdf1161af2fde5da6610ba8a8f72;p=ceph.git cephfs-top: navigate to home screen when no fs Return back to the home (All Filesystem Info) screen, when all the filesystems are removed while waiting for a key input in set_key(). There's no need to return to `Selected FS` screen. Fixes: https://tracker.ceph.com/issues/58823 Signed-off-by: Jos Collin (cherry picked from commit 61e097b2cbc7eac83f9cff644f500be9247f7847) --- diff --git a/src/tools/cephfs/top/cephfs-top b/src/tools/cephfs/top/cephfs-top index f6bab537e3b..f0ecbeffdaf 100755 --- a/src/tools/cephfs/top/cephfs-top +++ b/src/tools/cephfs/top/cephfs-top @@ -278,7 +278,7 @@ class FSTop(object): stdscr.clear() h, w = stdscr.getmaxyx() title = ['No filesystem available', - 'Press "q" to go back to home (all filesystem info) screen'] + 'Press "q" to go back to home (All Filesystem Info) screen'] pos_x1 = w // 2 - len(title[0]) // 2 pos_x2 = w // 2 - len(title[1]) // 2 stdscr.addstr(1, pos_x1, title[0], curses.A_STANDOUT | curses.A_BOLD) @@ -306,10 +306,10 @@ class FSTop(object): endmenu = True elif key == ord('q'): self.stdscr.erase() - if self.active_screen == FS_TOP_ALL_FS_APP: - self.run_all_display() - else: + if fs_list and self.active_screen == FS_TOP_FS_SELECTED_APP: self.run_display() + else: + self.run_all_display() endmenu = True try: