Skip to content

Commit 2dff4d8

Browse files
authored
Merge pull request #3 from vikumarks/work-json-support-platform-temp
Work json support platform temp
2 parents 1e2f12a + 7332206 commit 2dff4d8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

scripts/tempershow

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TemperShow(object):
2828
self.db = SonicV2Connector(host="127.0.0.1")
2929
self.db.connect(self.db.STATE_DB)
3030

31-
def show(self):
31+
def show(self, output_json):
3232
keys = self.db.keys(self.db.STATE_DB, TEMPER_TABLE_NAME + '*')
3333
if not keys:
3434
print('Thermal Not detected\n')
@@ -74,7 +74,8 @@ class TemperShow(object):
7474
else:
7575
print('No temperature data available\n')
7676

77-
77+
78+
if __name__ == "__main__":
7879
parser = argparse.ArgumentParser(description='Display the temperature Sensor information',
7980
formatter_class=argparse.RawTextHelpFormatter,
8081
epilog="""

show/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def fan():
150150

151151
# 'temperature' subcommand ("show platform temperature")
152152
@platform.command()
153-
@click.option('--json', is_flag=True, help="Output in JSON format")
153+
@click.option('-j', '--json', is_flag=True, help="Output in JSON format")
154154
def temperature(json):
155155
"""Show device temperature information"""
156156
cmd = ['tempershow']

0 commit comments

Comments
 (0)