]> git.decadent.org.uk Git - dak.git/commitdiff
admin: Show options set in configuration database
authorAnsgar Burchardt <ansgar@debian.org>
Fri, 25 Mar 2011 13:49:27 +0000 (13:49 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Fri, 25 Mar 2011 13:49:27 +0000 (13:49 +0000)
Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
dak/admin.py

index 808fb88785edb626b99d46881da114a58f276ee5..d159651e75df850904971df8f7b3705b4bbd6837 100755 (executable)
@@ -59,6 +59,7 @@ Perform administrative work on the dak database.
   config / c:
      c db                   show db config
      c db-shell             show db config in a usable form for psql
+     c NAME                 show option NAME as set in configuration table
 
   architecture / a:
      a list                 show a list of architectures
@@ -456,7 +457,12 @@ def show_config(command):
             e.append('PGPORT')
         print "export " + " ".join(e)
     else:
-        die("E: config command unknown")
+        session = DBConn().session()
+        try:
+            o = session.query(DBConfig).filter_by(name = mode).one()
+            print o.value
+        except NoResultFound:
+            print "W: option '%s' not set" % mode
 
 dispatch['config'] = show_config
 dispatch['c'] = show_config