]> scripts.mit.edu Git - wizard.git/blobdiff - lib/wizard/command/summary.py
Implement mass migrate.
[wizard.git] / lib / wizard / command / summary.py
index 689225c139c97a191f3081844b5a05d6c9b73a10..267240366b26d784954068f6241238aec40c75d0 100644 (file)
@@ -2,6 +2,7 @@ import optparse
 import wizard.deploy as wd
 import sys
 
+# XXX: Migrate this to use logger
 class Printer(object):
     def __init__(self, quiet, verbose):
         self.i = 0
@@ -34,7 +35,7 @@ class Printer(object):
             self._hang()
             print str
 
-def main(argv, global_options):
+def summary(argv, global_options):
     usage = """usage: %prog summary [ARGS] APPS
 
 Scans all of the collected data from parallel-find.pl, and
@@ -74,10 +75,11 @@ Examples:
         except wd.NoSuchApplication:
             unrecognized += 1
             continue
-        if deploy.application.name + "-" + str(deploy.getVersion()) in show:
+        name = deploy.getApplication().name
+        if name + "-" + str(deploy.getVersion()) in show:
             printer.write("%s-%s deployment at %s" \
-                % (deploy.application.name, deploy.getVersion(), deploy.location))
-        elif deploy.application.name in show:
+                % (name, deploy.getVersion(), deploy.location))
+        elif name in show:
             pass
         else:
             continue
@@ -89,7 +91,7 @@ Examples:
     printer.write()
     for app in wd.applications.values():
         if app.name not in show: continue
-        printer.write(app)
+        printer.write(app.report())
         printer.write()
     printer.write("With %d errors and %d unrecognized applications" % (errors, unrecognized))