src/client.py
changeset 1570 838ff2534e0b
parent 1563 b24d60ef4c70
child 1603 84bd53597209
--- a/src/client.py	Sat Dec 12 14:17:27 2009 -0800
+++ b/src/client.py	Sat Dec 12 15:42:44 2009 -0800
@@ -586,7 +586,7 @@
                 return EXIT_OOPS
         return EXIT_OK
 
-def __api_prepare(operation, api_inst, verbose=False):
+def __api_prepare(operation, api_inst):
         # Exceptions which happen here are printed in the above level, with
         # or without some extra decoration done here.
         # XXX would be nice to kick the progress tracker.
@@ -600,8 +600,6 @@
         except api_errors.TransportError, e:
                 # move past the progress tracker line.
                 msg("\n")
-                if verbose:
-                        e.verbose = True
                 raise e
         except KeyboardInterrupt:
                 raise
@@ -786,14 +784,11 @@
 
         # Exceptions which happen here are printed in the above level, with
         # or without some extra decoration done here.
-        if not __api_prepare("change-variant", api_inst, verbose=verbose):
+        if not __api_prepare("change-variant", api_inst):
                 return EXIT_OOPS
 
         ret_code = __api_execute_plan("change-variant", api_inst)
 
-        if bool(os.environ.get("PKG_MIRROR_STATS", False)):
-                print_mirror_stats(api_inst)
-
         return ret_code
 
 def change_facet(img, args):
@@ -874,14 +869,11 @@
 
         # Exceptions which happen here are printed in the above level, with
         # or without some extra decoration done here.
-        if not __api_prepare(op, api_inst, verbose=verbose):
+        if not __api_prepare(op, api_inst):
                 return EXIT_OOPS
 
         ret_code = __api_execute_plan(op, api_inst)
 
-        if bool(os.environ.get("PKG_MIRROR_STATS", False)):
-                print_mirror_stats(api_inst)
-
         return ret_code
 
 def image_update(img, args):
@@ -942,7 +934,7 @@
         if noexecute:
                 return EXIT_OK
 
-        if not __api_prepare(op, api_inst, verbose=verbose):
+        if not __api_prepare(op, api_inst):
                 return EXIT_OOPS
 
         ret_code = __api_execute_plan(op, api_inst)
@@ -953,20 +945,8 @@
                 msg(misc.get_release_notes_url())
                 msg("-" * 75 + "\n")
 
-        if bool(os.environ.get("PKG_MIRROR_STATS", False)):
-                print_mirror_stats(api_inst)
-
         return ret_code
 
-def print_mirror_stats(api_inst):
-        """Given an api_inst object, print depot status information."""
-
-        status_fmt = "%-10s %-35s %10s %10s"
-        print status_fmt % ("Publisher", "URI", "Success", "Failure")
-
-        for ds in api_inst.img.gen_depot_status():
-                print status_fmt % (ds.prefix, ds.url, ds.good_tx, ds.errors)
-
 def install(img, args):
         """Attempt to take package specified to INSTALLED state.  The operands
         are interpreted as glob patterns."""
@@ -1021,15 +1001,12 @@
 
         # Exceptions which happen here are printed in the above level, with
         # or without some extra decoration done here.
-        if not __api_prepare(op, api_inst, verbose=verbose):
+        if not __api_prepare(op, api_inst):
                 return EXIT_OOPS
 
         ret_code = __api_execute_plan(op, api_inst,
             raise_ActionExecutionError=False)
 
-        if bool(os.environ.get("PKG_MIRROR_STATS", False)):
-                print_mirror_stats(api_inst)
-
         return ret_code
 
 
@@ -1078,7 +1055,7 @@
 
         # Exceptions which happen here are printed in the above level, with
         # or without some extra decoration done here.
-        if not __api_prepare(op, api_inst, verbose=verbose):
+        if not __api_prepare(op, api_inst):
                 return EXIT_OOPS
 
         return __api_execute_plan(op, api_inst)