From 3e0cf8ed312d3c69bb5f0b33b9b3589ac6eef7ee Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Fri, 21 Feb 2014 07:10:11 +0100 Subject: [PATCH] osc staging check with argument should give more output than without (issue 1587) --- osc-staging.py | 2 +- osclib/stagingapi.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/osc-staging.py b/osc-staging.py index 911fb533..396189c7 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -184,7 +184,7 @@ def do_staging(self, subcmd, opts, *args): # call the respective command and parse args by need if cmd in ['check']: if len(args) > 1: - return api.check_project_status(api.prj_from_letter(args[1])) + return api.check_project_status(api.prj_from_letter(args[1]), verbose=True) for prj in api.get_staging_projects(): print("Checking {}".format(prj)) api.check_project_status(prj) diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index e390f680..9f2c5265 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -396,7 +396,7 @@ class StagingAPI(object): state = 'missing reviews: ' + ', '.join(failing_groups) return '{0}: {1}'.format(package, state) - def check_project_status(self, project): + def check_project_status(self, project, verbose=False): """ Checks a staging project for acceptance. Checks all open requests for open reviews and build status @@ -422,7 +422,8 @@ class StagingAPI(object): if ret: print(ret) all = False - break # TODO: offer a details option + if not verbose: + break buildstatus = self.gather_build_status(project) if buildstatus: @@ -516,14 +517,15 @@ class StagingAPI(object): else: return [project, working, broken] - def print_build_status_details(self, details): + def print_build_status_details(self, details, verbose=False): project, working, broken = details if len(working) != 0: print("At least following repositories is still building:") for i in working: print(" {0}: {1}".format(i['path'], i['state'])) - break # TODO offer details option + if not verbose: + break print if len(broken) != 0: print("Following packages are broken:")