Support Wait State keyword inside plugin.
Signed-off-by: Michael Shepos <shepos@us.ibm.com>
Change-Id: If6120c480efdc65ab031fbdb0570b0b19860a768
diff --git a/lib/bmc_ssh_utils.py b/lib/bmc_ssh_utils.py
index f9aaeb6..9dc3bd4 100755
--- a/lib/bmc_ssh_utils.py
+++ b/lib/bmc_ssh_utils.py
@@ -74,7 +74,11 @@
fork=0,
quiet=None,
test_mode=None,
- time_out=None):
+ time_out=None,
+ os_host="",
+ os_username="",
+ os_password=""):
+
r"""
Run the given command in an OS SSH session and return the stdout, stderr and the return code.
@@ -100,11 +104,12 @@
"""
# Get global OS variable values.
- os_host = BuiltIn().get_variable_value("${OS_HOST}", default="")
- os_username = BuiltIn().get_variable_value("${OS_USERNAME}",
- default="")
- os_password = BuiltIn().get_variable_value("${OS_PASSWORD}",
- default="")
+ if os_host == "":
+ os_host = BuiltIn().get_variable_value("${OS_HOST}", default="")
+ if os_username is "":
+ os_username = BuiltIn().get_variable_value("${OS_USERNAME}", default="")
+ if os_password is "":
+ os_password = BuiltIn().get_variable_value("${OS_PASSWORD}", default="")
if not gv.valid_value(os_host):
return "", "", 1
diff --git a/lib/state.py b/lib/state.py
index 3eb3473..d13e50a 100755
--- a/lib/state.py
+++ b/lib/state.py
@@ -462,7 +462,10 @@
if must_login:
output, stderr, rc = bsu.os_execute_command("uptime", quiet=quiet,
ignore_err=1,
- time_out=20)
+ time_out=20,
+ os_host=os_host,
+ os_username=os_username,
+ os_password=os_password)
if rc == 0:
os_login = 1
os_run_cmd = 1