]> err.no Git - dak/commitdiff
Make dominate -s <suite> work without Obsolete::Options::Suite set.
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 10 May 2012 08:22:40 +0000 (10:22 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 10 May 2012 08:27:32 +0000 (10:27 +0200)
dak/dominate.py

index 5c919ab89b05a74f1082c78159c10df843e79805..be8c52203958486c8ae229a300149efa22f09351 100755 (executable)
@@ -125,10 +125,6 @@ def main():
                  ('s', "suite",     "Obsolete::Options::Suite", "HasArg"),
                  ('n', "no-action", "Obsolete::Options::No-Action"),
                  ('f', "force",     "Obsolete::Options::Force")]
-    query_suites = DBConn().session().query(Suite)
-    suites = [suite.suite_name for suite in query_suites.all()]
-    if not cnf.has_key('Obsolete::Options::Suite'):
-        cnf['Obsolete::Options::Suite'] = ','.join(suites)
     cnf['Obsolete::Options::Help'] = ''
     cnf['Obsolete::Options::No-Action'] = ''
     cnf['Obsolete::Options::Force'] = ''
@@ -136,6 +132,10 @@ def main():
     Options = cnf.subtree("Obsolete::Options")
     if Options['Help']:
         usage()
+    if 'Suite' not in Options:
+        query_suites = DBConn().session().query(Suite)
+        suites = [suite.suite_name for suite in query_suites.all()]
+        cnf['Obsolete::Options::Suite'] = ','.join(suites)
     Logger = daklog.Logger("dominate")
     session = DBConn().session()
     for suite_name in utils.split_args(Options['Suite']):