From 8d0df0ad1288323bd0f5ad118d5a8d6a500bfd6e Mon Sep 17 00:00:00 2001 From: Travis Van Duyn Date: Wed, 4 Sep 2019 17:46:17 -0700 Subject: [PATCH] [show] Add 'show boot' command (#630) --- doc/Command-Reference.md | 15 +++++++++++++++ show/main.py | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/doc/Command-Reference.md b/doc/Command-Reference.md index 97ac6f9c6c7e..a7ed0ec02159 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -382,6 +382,21 @@ This command displays the current date and time configured on the system Mon Mar 25 20:25:16 UTC 2019 ``` +**show boot** +This command displays the current OS image, the image loaded on next reboot, and the lists the available images on the system + +- Usage: + show boot + +- Example: + ``` + admin@sonic:~$ show boot + Current: SONiC-OS-20181130.31 + Next: SONiC-OS-20181130.31 + Available: + SONiC-OS-20181130.31 + ``` + **show environment** This command displays the platform environmentals, such as voltages, temperatures and fan speeds diff --git a/show/main.py b/show/main.py index 1cd0aedccc8b..da4e3ae87948 100755 --- a/show/main.py +++ b/show/main.py @@ -1860,6 +1860,17 @@ def ecn(): click.echo(proc.stdout.read()) +# +# 'boot' command ("show boot") +# +@cli.command('boot') +def boot(): + """Show boot configuration""" + cmd = "sudo sonic_installer list" + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) + click.echo(proc.stdout.read()) + + # 'mmu' command ("show mmu") # @cli.command('mmu')