Fix print_var calls: new fmt, indent, etc.

Changed print_var calls to correctly use new arguments:
 - fmt
 - indent
 - col1_width

Change-Id: If80088d5b69865074fd510421b918da7fd8e874e
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/func_timer.py b/lib/func_timer.py
index d07ba32..ef837ef 100644
--- a/lib/func_timer.py
+++ b/lib/func_timer.py
@@ -60,14 +60,12 @@
             func_name = self.__func.__name__
         except AttributeError:
             func_name = ""
-        buffer += gp.sprint_var(func_name, hex=1, loc_col1_indent=indent)
-        buffer += gp.sprint_varx("time_out", self.__time_out,
-                                 loc_col1_indent=indent)
-        buffer += gp.sprint_varx("child_pid", self.__child_pid,
-                                 loc_col1_indent=indent)
+        buffer += gp.sprint_var(func_name, indent=indent)
+        buffer += gp.sprint_varx("time_out", self.__time_out, indent=indent)
+        buffer += gp.sprint_varx("child_pid", self.__child_pid, indent=indent)
         buffer += gp.sprint_varx("original_SIGUSR1_handler",
                                  self.__original_SIGUSR1_handler,
-                                 loc_col1_indent=indent)
+                                 indent=indent)
         return buffer
 
     def print_obj(self):
diff --git a/lib/gen_arg.py b/lib/gen_arg.py
index 7c82ece..f4abbe5 100755
--- a/lib/gen_arg.py
+++ b/lib/gen_arg.py
@@ -197,13 +197,13 @@
                                     of output.
     """
 
-    loc_col1_width = gp.col1_width + indent
+    col1_width = gp.dft_col1_width + indent
 
     buffer = ""
 
     for key in arg_obj.__dict__:
         buffer += gp.sprint_varx(key, getattr(arg_obj, key), 0, indent,
-                                 loc_col1_width)
+                                 col1_width)
 
     return buffer
 
diff --git a/lib/gen_call_robot.py b/lib/gen_call_robot.py
index 3944c79..0372698 100755
--- a/lib/gen_call_robot.py
+++ b/lib/gen_call_robot.py
@@ -347,7 +347,7 @@
         gp.qprint_timen("No robot output files were found in " + outputdir
                         + ".")
         return
-    gp.qprint_var(robot_rc, 1)
+    gp.qprint_var(robot_rc, gp.hexa())
     if SAVE_STATUS_POLICY == "FAIL" and robot_rc == 0:
         gp.qprint_timen("The call to robot produced no failures."
                         + "  Deleting robot output files.")
@@ -480,8 +480,7 @@
     gcr_last_robot_rc = shell_rc
     process_robot_output_files()
     if shell_rc != 0:
-        hex = 1
-        gp.print_var(shell_rc, hex)
+        gp.print_var(shell_rc, gp.hexa())
         return False
 
     return True
diff --git a/lib/gen_misc.py b/lib/gen_misc.py
index 0dc0d64..9631182 100755
--- a/lib/gen_misc.py
+++ b/lib/gen_misc.py
@@ -66,7 +66,7 @@
     if shell_rc != 0:
         error_message = "Failed to find complete path for file \"" +\
                         file_path + "\".\n"
-        error_message += gp.sprint_var(shell_rc, 1)
+        error_message += gp.sprint_var(shell_rc, gp.hexa())
         error_message += out_buf
         if robot_env:
             BuiltIn().fail(gp.sprint_error(error_message))
@@ -454,10 +454,10 @@
 
     var1 = 0xfffffffffffffff1
     print_var(var1)
-    print_var(var1, 1)
+    print_var(var1, hexa())
     var1 = to_signed(var1)
     print_var(var1)
-    print_var(var1, 1)
+    print_var(var1, hexa())
 
     The following is written to stdout:
     var1:  18446744073709551601
diff --git a/lib/gen_robot_plug_in.py b/lib/gen_robot_plug_in.py
index 31236c4..1088cb5 100755
--- a/lib/gen_robot_plug_in.py
+++ b/lib/gen_robot_plug_in.py
@@ -212,12 +212,11 @@
     failed_plug_in_name = properties.get('failed_plug_in_name', '')
 
     if proc_plug_pkg_rc != 0:
-        hex = 1
         if quiet:
             os.system("cat " + temp_file_path + " >&2")
         if grep_rc != 0:
-            gp.print_varx("grep_rc", grep_rc, hex)
-        gp.print_varx("proc_plug_pkg_rc", proc_plug_pkg_rc, hex)
+            gp.print_var(grep_rc, gp.hexa())
+        gp.print_var(proc_plug_pkg_rc, gp.hexa())
         gp.print_timen("Re-cap of plug-in failures:")
         gc.cmd_fnc_u("egrep -A 1 '^failed_plug_in_name:[ ]+' "
                      + temp_properties_file_path + " | egrep -v '^\\--'",
diff --git a/lib/gen_robot_ssh.py b/lib/gen_robot_ssh.py
index 1c9f564..770f67b 100755
--- a/lib/gen_robot_ssh.py
+++ b/lib/gen_robot_ssh.py
@@ -149,7 +149,7 @@
                 # re-raise exception.
                 break
         # If we get to this point, the login has worked and we can return.
-        gp.lpvar(out_buf)
+        gp.lprint_var(out_buf)
         return
 
     # If we get to this point, the login has failed on all attempts so the
@@ -339,7 +339,7 @@
         return
 
     if rc != 0 and print_err:
-        gp.print_var(rc, 1)
+        gp.print_var(rc, gp.hexa())
         if not print_out:
             gp.print_var(stderr)
             gp.print_var(stdout)
@@ -350,7 +350,8 @@
     if not ignore_err:
         message = gp.sprint_error("The prior SSH"
                                   + " command returned a non-zero return"
-                                  + " code:\n" + gp.sprint_var(rc, 1) + stderr
+                                  + " code:\n"
+                                  + gp.sprint_var(rc, gp.hexa()) + stderr
                                   + "\n")
         BuiltIn().should_be_equal(rc, 0, message)
 
diff --git a/lib/gen_valid.py b/lib/gen_valid.py
index ad5de1f..882e31d 100755
--- a/lib/gen_valid.py
+++ b/lib/gen_valid.py
@@ -154,7 +154,6 @@
                          gp.sprint_var(valid_values)
         return error_message
 
-    show_blanks = 1
     if len_valid_values > 0:
         # Processing the valid_values list.
         if var_value in valid_values:
@@ -162,10 +161,9 @@
         error_message += "The following variable has an invalid" +\
                          " value:\n" +\
                          gp.sprint_varx(get_var_name(var_name), var_value,
-                                        show_blanks) +\
+                                        gp.blank()) +\
                          "\nIt must be one of the following values:\n" +\
-                         gp.sprint_varx("valid_values", valid_values,
-                                        show_blanks)
+                         gp.sprint_var(valid_values, gp.blank())
         return error_message
 
     if len_invalid_values == 0:
@@ -178,10 +176,9 @@
 
     error_message += "The following variable has an invalid value:\n" +\
                      gp.sprint_varx(get_var_name(var_name), var_value,
-                                    show_blanks) +\
+                                    gp.blank()) +\
                      "\nIt must NOT be one of the following values:\n" +\
-                     gp.sprint_varx("invalid_values", invalid_values,
-                                    show_blanks)
+                     gp.sprint_var(invalid_values, gp.blank())
     return error_message
 
 
@@ -228,10 +225,9 @@
         pass
 
     # If we get to this point, the validation has failed.
-    show_blanks = 1
     error_message +=\
         "Invalid integer value:\n" +\
-        gp.sprint_varx(get_var_name(var_name), var_value, show_blanks)
+        gp.sprint_varx(get_var_name(var_name), var_value, gp.blank())
 
     return error_message
 
@@ -437,8 +433,7 @@
         if valid_range[0] is not None and valid_range[0] > valid_range[1]:
             error_message = "Programmer error - In the following range, the" +\
                             " lower limit is greater than the upper" +\
-                            " limit:\n" + gp.sprint_varx("valid_range",
-                                                         valid_range)
+                            " limit:\n" + gp.sprint_var(valid_range)
             return error_message
 
     if len_valid_range == 1:
@@ -513,7 +508,6 @@
 
     error_message = ""
     if len(var_value) == 0:
-        show_blanks = 1
         error_message += "The \"" + get_var_name(var_name)
         error_message += "\" list is empty and is therefore invalid:\n"
         return error_message
@@ -526,10 +520,9 @@
             display_var_value[ix] = var_value[ix] + "*"
 
     if found_error:
-        show_blanks = 1
         error_message += "The list entries marked with \"*\" are not valid:\n"
         error_message += gp.sprint_varx(get_var_name(var_name),
-                                        display_var_value, show_blanks)
+                                        display_var_value, gp.blank())
         error_message += gp.sprint_var(valid_values)
         return error_message
 
@@ -577,12 +570,11 @@
 
     keys_missing = list(set(required_keys) - set(var_value.keys()))
     if len(keys_missing) > 0:
-        show_blanks = 1
         var_name = get_var_name(var_name)
         error_message = "The following key fields are missing from "
         error_message += var_name + ":\n"
         error_message += gp.sprint_var(keys_missing)
-        error_message += gp.sprint_varx(var_name, var_value, show_blanks)
+        error_message += gp.sprint_varx(var_name, var_value, gp.blank())
         return error_message
 
     return ""
diff --git a/lib/logging_utils.py b/lib/logging_utils.py
index 9c43f21..c0ba4ab 100644
--- a/lib/logging_utils.py
+++ b/lib/logging_utils.py
@@ -74,7 +74,7 @@
             pass
         key_list.insert(0, var.BMC_LOGGING_ENTRY + ".*")
 
-    gp.print_var(error_logs, hex=1, key_list=key_list)
+    gp.print_var(error_logs, gp.terse(), key_list=key_list)
 
 
 def get_esels(error_logs=None):
diff --git a/lib/openbmctool_utils.py b/lib/openbmctool_utils.py
index 96e7b5f..1a79b7d 100755
--- a/lib/openbmctool_utils.py
+++ b/lib/openbmctool_utils.py
@@ -126,7 +126,7 @@
     Example robot code:
 
     ${fru_status}=  Get Fru Status
-    Rprint Vars  1  fru_status
+    Rprint Vars  fru_status  fmt=1
 
     Example result (excerpt):
 
@@ -196,7 +196,7 @@
     Example robot code:
 
     ${fru_print}=  Get Fru Print
-    Rprint Vars  1  fru_print
+    Rprint Vars  fru_print  fmt=1
 
     Example result (excerpt):
 
@@ -267,7 +267,7 @@
     Example robot code:
 
     ${fru_list}=  Get Fru List
-    Rprint Vars  1  fru_list
+    Rprint Vars  fru_list  fmt=1
 
     Example result (excerpt):
 
@@ -312,7 +312,7 @@
     Example robot code:
 
     ${sensors_print}=  Get Sensors Print
-    Rprint Vars  1  sensors_print
+    Rprint Vars  sensors_print  fmt=1
 
     Example result (excerpt):
 
@@ -351,7 +351,7 @@
     Example robot code:
 
     ${sensors_list}=  Get Sensors List
-    Rprint Vars  1  sensors_list
+    Rprint Vars  sensors_list  fmt=1
 
     Example result (excerpt):
 
@@ -483,7 +483,7 @@
     Example robot code:
 
     ${health_check}=  Get Health Check
-    Rpvars  1  health_check
+    Rprint Vars  health_check  fmt=1
 
     Example result:
 
@@ -530,7 +530,7 @@
     Example robot code:
 
     ${remote_logging_view}=  Get Remote Logging View
-    Rpvars  1  remote_logging_view
+    Rprint Vars  remote_logging_view  fmt=1
 
     Example result:
 
diff --git a/lib/var_stack.py b/lib/var_stack.py
index 5bb56a7..f09845c 100644
--- a/lib/var_stack.py
+++ b/lib/var_stack.py
@@ -92,7 +92,8 @@
 
         buffer += self.__obj_name + ":\n"
         indent = 2
-        buffer += gp.sprint_varx('stack_dict', self.__stack_dict, 1, indent)
+        buffer += gp.sprint_varx('stack_dict', self.__stack_dict, gp.terse(),
+                                 indent)
 
         return buffer