File tree 3 files changed +36
-4
lines changed
3 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 57
57
from . import warm_restart
58
58
from . import plugins
59
59
60
-
61
60
# Global Variables
62
61
PLATFORM_JSON = 'platform.json'
63
62
HWSKU_JSON = 'hwsku.json'
@@ -1676,12 +1675,10 @@ def ztp(status, verbose):
1676
1675
cmd = cmd + " --verbose"
1677
1676
run_command (cmd , display_cmd = verbose )
1678
1677
1679
-
1680
1678
# Load plugins and register them
1681
1679
helper = util_base .UtilHelper ()
1682
1680
for plugin in helper .load_plugins (plugins ):
1683
1681
helper .register_plugin (plugin , cli )
1684
1682
1685
-
1686
1683
if __name__ == '__main__' :
1687
1684
cli ()
Original file line number Diff line number Diff line change @@ -134,7 +134,6 @@ def temperature():
134
134
cmd = 'tempershow'
135
135
clicommon .run_command (cmd )
136
136
137
-
138
137
# 'firmware' subcommand ("show platform firmware")
139
138
@platform .command (
140
139
context_settings = dict (
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ #########################################################
3
+ # Copyright 2021 Cisco Systems, Inc.
4
+ # All rights reserved.
5
+ #
6
+ # CLI Extensions for show command
7
+ #########################################################
8
+
9
+ try :
10
+ import click
11
+ import yaml
12
+ from show import platform
13
+ from sonic_py_common import device_info
14
+ import utilities_common .cli as clicommon
15
+ except ImportError as e :
16
+ raise ImportError ("%s - required module not found" % str (e ))
17
+
18
+ PLATFORM_PY = '/opt/cisco/bin/platform.py'
19
+
20
+ @click .command ()
21
+ def inventory ():
22
+ """Show Platform Inventory"""
23
+ args = [ PLATFORM_PY , 'inventoryshow' ]
24
+ clicommon .run_command (args )
25
+
26
+ @click .command ()
27
+ def idprom ():
28
+ """Show Platform Idprom Inventory"""
29
+ args = [ PLATFORM_PY , 'idprom' ]
30
+ clicommon .run_command (args )
31
+
32
+ def register (cli ):
33
+ version_info = device_info .get_sonic_version_info ()
34
+ if (version_info and version_info .get ('asic_type' ) == 'cisco-8000' ):
35
+ cli .commands ['platform' ].add_command (inventory )
36
+ cli .commands ['platform' ].add_command (idprom )
You can’t perform that action at this time.
0 commit comments