From 45b346d1c35c2744c46c8769df872df159899a9c Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 19 May 2015 12:02:04 +0200 Subject: [PATCH] require passing --web-url --- abichecker/abichecker.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/abichecker/abichecker.py b/abichecker/abichecker.py index 3a19067b..e6b9eae8 100755 --- a/abichecker/abichecker.py +++ b/abichecker/abichecker.py @@ -52,7 +52,7 @@ from xdg.BaseDirectory import save_cache_path import ReviewBot -WEB_URL="http://127.0.0.1:5000/report" +WEB_URL=None # Directory where download binary packages. BINCACHE = os.path.expanduser('~/co') @@ -712,8 +712,19 @@ class CommandLineInterface(ReviewBot.CommandLineInterface): def get_optparser(self): parser = ReviewBot.CommandLineInterface.get_optparser(self) parser.add_option("--comments", action="store_true", help="post comments") + parser.add_option("--web-url", metavar="URL", help="URL of web service") return parser + def postoptparse(self): + ret = ReviewBot.CommandLineInterface.postoptparse(self) + if self.options.web_url is not None: + global WEB_URL + WEB_URL = self.options.web_url + else: + self.optparser.error("must specify --web-url") + ret = False + return ret + def setup_checker(self): apiurl = osc.conf.config['apiurl']