| import bmc_ssh_utils as bsu |
| def vpdtool(option_string, **bsu_options): |
| Run vpdtool on the BMC with the caller's option string and return the result. |
| ${vpd_results}= vpd-tool -i |
| [/system/chassis/motherboard]: |
| [LocationCode]: U78DA.ND1. -P0 |
| [type]: xyz.openbmc_project.Inventory.Item.Board.Motherboard |
| [/system/chassis/motherboard/ebmc_card_bmc]: |
| [LocationCode]: U78DA.ND1. -P0-C5 |
| [type]: xyz.openbmc_project.Inventory.Item.Bmc |
| Description of argument(s): |
| option_string A string of options which are to be processed by the vpd-tool command. |
| bsu_options Options to be passed directly to bmc_execute_command. See its prolog for |
| bsu_options = fa.args_to_objects(bsu_options) |
| out_buf, stderr, rc = bsu.bmc_execute_command('vpd-tool ' + option_string, **bsu_options) |
| # Only return output if its not a VPD write command. |
| if '-w' not in option_string: |
| out_buf = json.loads(out_buf) |
| if '-r' in option_string: |