]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-top: navigate to home screen when no fs 50177/head
authorJos Collin <jcollin@redhat.com>
Mon, 20 Feb 2023 06:11:53 +0000 (11:41 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 22 Feb 2023 08:25:14 +0000 (13:55 +0530)
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 <jcollin@redhat.com>
src/tools/cephfs/top/cephfs-top

index 5461b9d759531866dced62a3fa4a3b527df8b2fe..3f480ad664d513563465e8b472c455edd73e9636 100755 (executable)
@@ -385,7 +385,7 @@ class FSTop(FSTopBase):
         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)
@@ -413,10 +413,10 @@ class FSTop(FSTopBase):
                 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: