New get_bmc_df function.
Change-Id: I1c1ef0afc531b1146dce1dcf8c60a1f94152b326
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/utils.py b/lib/utils.py
index 100d3af..bd918c7 100644
--- a/lib/utils.py
+++ b/lib/utils.py
@@ -151,3 +151,37 @@
return result_time_dict
+
+def get_bmc_df(df_parm_string=""):
+
+ r"""
+ Get df report from BMC and return as a report "object".
+
+ A df report object is a list where each entry is a dictionary whose keys
+ are the field names from the first entry in report_list.
+
+ Example df report object:
+
+ df_report:
+ df_report[0]:
+ [filesystem]: dev
+ [1k-blocks]: 247120
+ [used]: 0
+ [available]: 247120
+ [use%]: 0%
+ [mounted]: /dev
+ df_report[1]:
+ [filesystem]: dev
+ [1k-blocks]: 247120
+ [used]: 0
+ [available]: 247120
+ [use%]: 0%
+ [mounted]: /dev
+
+. Description of argument(s):
+ df_parm_string A string containing valid df command parms (e.g.
+ "-h /var").
+ """
+
+ out_buf, stderr, rc = bsu.bmc_execute_command("df " + df_parm_string)
+ return vf.outbuf_to_report(out_buf)