Use SSH_PORT/HTTPS_PORT in basic functions

- In order to improve the code base's ability to run with simulated
machines, specified SSH_PORT and HTTPS_PORT in basic functions that
communicate with the OBMC machine.
- Also adjusted some calls to set or pass SSH_PORT and HTTPS_PORT.

Change-Id: If3a8b317eda80ac9c071c51084ede20ce3023484
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/openbmctool_utils.py b/lib/openbmctool_utils.py
index 17595c4..7f98963 100755
--- a/lib/openbmctool_utils.py
+++ b/lib/openbmctool_utils.py
@@ -63,6 +63,7 @@
 
     # Get global BMC variable values.
     openbmc_host = BuiltIn().get_variable_value("${OPENBMC_HOST}", default="")
+    https_port = BuiltIn().get_variable_value("${HTTPS_PORT}", default="443")
     openbmc_username = BuiltIn().get_variable_value("${OPENBMC_USERNAME}",
                                                     default="")
     openbmc_password = BuiltIn().get_variable_value("${OPENBMC_PASSWORD}",
@@ -73,6 +74,8 @@
         return "", "", 1
     if not gv.valid_value(openbmc_password):
         return "", "", 1
+    if not gv.valid_value(https_port):
+        return "", "", 1
 
     # Break the caller's command up into separate piped commands.  For
     # example, the user may have specified "fru status | head -n 2" which
@@ -87,7 +90,7 @@
                     " has been logged out'")
 
     command_string = "set -o pipefail ; python3 $(which openbmctool.py) -H "\
-        + openbmc_host + " -U " + openbmc_username + " -P " + openbmc_password\
+        + openbmc_host + ":" + https_port + " -U " + openbmc_username + " -P " + openbmc_password\
         + " " + " ".join(pipeline)
 
     return gc.shell_cmd(command_string, *args, **kwargs)