Added format specifier for date
Changes:
- Modified existing method so that caller can specify
a format for the date - Get Current Date from BMC
Tested:
- Dummy test
Change-Id: Iaa228e98c201556359a4e442dc1038d9dced0939
Signed-off-by: Anusha Dathatri <adathatr@in.ibm.com>
diff --git a/lib/ipmi_client.robot b/lib/ipmi_client.robot
index 264940f..984b187 100755
--- a/lib/ipmi_client.robot
+++ b/lib/ipmi_client.robot
@@ -568,6 +568,10 @@
Get Current Date from BMC
[Documentation] Runs the date command from BMC and returns current date and time
+ [Arguments] ${date_format}=%m/%d/%Y %H:%M:%S
+
+ # Description of argument(s):
+ # date_format Date format of the result. E.g. %Y-%m-%d %H:%M:%S etc.
# Get Current Date from BMC
${date} ${stderr} ${rc}= BMC Execute Command date
@@ -578,8 +582,8 @@
Remove From List ${date} -2
${date}= Evaluate " ".join(${date})
- # Convert the date format to %m/%d/%Y %H:%M:%S
- ${date}= Convert Date ${date} date_format=%b %d %H:%M:%S %Y result_format=%m/%d/%Y %H:%M:%S exclude_millis=True
+ # Convert the date to specified format, default:%m/%d/%Y %H:%M:%S
+ ${date}= Convert Date ${date} date_format=%b %d %H:%M:%S %Y result_format=${date_format} exclude_millis=True
[Return] ${date}