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 <sridevra@in.ibm.com>
diff --git a/lib/pel_utils.py b/lib/pel_utils.py
index 962d434..58222e5 100644
--- a/lib/pel_utils.py
+++ b/lib/pel_utils.py
@@ -28,7 +28,9 @@
super().__init__(self.message)
-def peltool(option_string, parse_json=True, **bsu_options):
+def peltool(
+ option_string, peltool_extension=None, parse_json=True, **bsu_options
+):
r"""
Run peltool on the BMC with the caller's option string and return the result.
@@ -51,6 +53,8 @@
Description of argument(s):
option_string A string of options which are to be
processed by the peltool command.
+ peltool_extension Provide peltool extension format.
+ Default: None.
parse_json Indicates that the raw JSON data should
parsed into a list of dictionaries.
bsu_options Options to be passed directly to
@@ -59,8 +63,12 @@
"""
bsu_options = fa.args_to_objects(bsu_options)
+ peltool_cmd = "peltool"
+ if peltool_extension:
+ peltool_cmd = peltool_cmd + peltool_extension
+
out_buf, _, _ = bsu.bmc_execute_command(
- "peltool " + option_string, **bsu_options
+ peltool_cmd + " " + option_string, **bsu_options
)
if parse_json:
try: