forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sonic-py-common] Add platform and chassis info methods to device_info (
sonic-net#7652) #### Why I did it These methods were added to make some convenient platform and chassis information methods accessible through sonic-py-common. These methods were refactored from sonic-utilities and are used in the `show platform summary` and `show version` commands. #### How I did it There are two methods, one is `get_platform_info()` which simply calls local methods to collect useful platform information into a dictionary format, this came directly from sonic-utilities.
- Loading branch information
1 parent
848e1f8
commit 433da78
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class SonicV2Connector: | ||
TEST_SERIAL = "MT1822K07815" | ||
TEST_MODEL = "MSN2700-CS2FO" | ||
TEST_REV = "A1" | ||
|
||
def __init__(self): | ||
self.STATE_DB = 'STATE_DB' | ||
self.data = {"serial": self.TEST_SERIAL, | ||
"model": self.TEST_MODEL, | ||
"revision": self.TEST_REV} | ||
|
||
def connect(self, db): | ||
pass | ||
|
||
def get(self, db, table, field): | ||
return self.data.get(field, "N/A") |