[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] dak/admin.py: optionally output the archive as well as the suite name in suite list



Signed-off-by: Tollef Fog Heen <tfheen@varnish-software.com>
---
 dak/admin.py |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dak/admin.py b/dak/admin.py
index 34485af..e4d1034 100755
--- a/dak/admin.py
+++ b/dak/admin.py
@@ -86,7 +86,8 @@ Perform administrative work on the dak database.
                             Ordered at ORDERING.
 
   suite / s:
-     s list                 show a list of suites
+     s list [--print-archive]
+                            show a list of suites
      s show SUITE           show config details for a suite
      s add SUITE VERSION [ label=LABEL ] [ description=DESCRIPTION ]
                          [ origin=ORIGIN ] [ codename=CODENAME ]
@@ -274,8 +275,11 @@ dispatch['component'] = component
 
 def __suite_list(d, args):
     s = d.session()
-    for j in s.query(Suite).order_by(Suite.suite_name).all():
-        print j.suite_name
+    for j in s.query(Suite).join(Suite.archive).order_by(Archive.archive_name, Suite.suite_name).all():
+        if len(args) > 2 and args[2] == "--print-archive":
+            print "{0} {1}".format(j.archive.archive_name, j.suite_name)
+        else:
+            print "{0}".format(j.suite_name)
 
 def __suite_show(d, args):
     if len(args) < 2:
-- 
1.7.10.4



Reply to: