From af9aa3678a3e3ea19dc43e5bc3584e73785bc42f Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 9 Dec 2013 16:57:09 -0500 Subject: [PATCH] make launchpad integration optional launchpad integration is nice, but it's incredibly slow. So there are times where it would be nice if it was optional. You can specify it on the command line with the -l flag. Change-Id: I7d5d57750c82efbc0936186625ceacecaf350085 --- elastic_recheck/cmd/check_success.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/elastic_recheck/cmd/check_success.py b/elastic_recheck/cmd/check_success.py index 38c3bc40..8610d207 100755 --- a/elastic_recheck/cmd/check_success.py +++ b/elastic_recheck/cmd/check_success.py @@ -30,6 +30,9 @@ def get_options(): description='Query for existing recheck bugs.') parser.add_argument('--dir', '-d', help="Queries Directory", default="queries") + parser.add_argument('--lp', '-l', help="Query Launchpad", + type=bool, + default=False) return parser.parse_args() @@ -53,7 +56,7 @@ def collect_metrics(classifier): return data -def print_metrics(data): +def print_metrics(data, with_lp=False): print "Elastic recheck known issues" print @@ -62,7 +65,8 @@ def print_metrics(data): for d in sorted_data: print("Bug: https://bugs.launchpad.net/bugs/%s => %s" % (d[0], d[1]['query'].rstrip())) - get_launchpad_bug(d[0]) + if with_lp: + get_launchpad_bug(d[0]) print "Hits" for s in d[1]['hits'].keys(): print " %s: %s" % (s, len(d[1]['hits'][s])) @@ -85,7 +89,7 @@ def main(): opts = get_options() classifier = er.Classifier(opts.dir) data = collect_metrics(classifier) - print_metrics(data) + print_metrics(data, with_lp=opts.lp) if __name__ == "__main__":