From: Ansgar Burchardt Date: Thu, 10 May 2012 08:22:40 +0000 (+0200) Subject: Make dominate -s work without Obsolete::Options::Suite set. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=abb084c52c7ef53b50e44a2c812b4588f20379ad;p=dak.git Make dominate -s work without Obsolete::Options::Suite set. --- diff --git a/dak/dominate.py b/dak/dominate.py index 5c919ab8..be8c5220 100755 --- a/dak/dominate.py +++ b/dak/dominate.py @@ -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']):