Skip to content

Commit 45b45c1

Browse files
SrideviRameshgkeishin
authored andcommitted
Add an option to provide extension for peltool
Changes: - Added a new argument to provide extension for peltool API. Tested: - Tested changes with and with out extension for peltool. Change-Id: Iaa0ad687b57205e9bd22d76ff2da6df3a171914f Signed-off-by: Sridevi Ramesh <[email protected]>
1 parent e8c0e42 commit 45b45c1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/pel_utils.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def __init__(self, message):
2828
super().__init__(self.message)
2929

3030

31-
def peltool(option_string, parse_json=True, **bsu_options):
31+
def peltool(
32+
option_string, peltool_extension=None, parse_json=True, **bsu_options
33+
):
3234
r"""
3335
Run peltool on the BMC with the caller's option string and return the result.
3436
@@ -51,6 +53,8 @@ def peltool(option_string, parse_json=True, **bsu_options):
5153
Description of argument(s):
5254
option_string A string of options which are to be
5355
processed by the peltool command.
56+
peltool_extension Provide peltool extension format.
57+
Default: None.
5458
parse_json Indicates that the raw JSON data should
5559
parsed into a list of dictionaries.
5660
bsu_options Options to be passed directly to
@@ -59,8 +63,12 @@ def peltool(option_string, parse_json=True, **bsu_options):
5963
"""
6064

6165
bsu_options = fa.args_to_objects(bsu_options)
66+
peltool_cmd = "peltool"
67+
if peltool_extension:
68+
peltool_cmd = peltool_cmd + peltool_extension
69+
6270
out_buf, _, _ = bsu.bmc_execute_command(
63-
"peltool " + option_string, **bsu_options
71+
peltool_cmd + " " + option_string, **bsu_options
6472
)
6573
if parse_json:
6674
try:

0 commit comments

Comments
 (0)