From 848e1b8889338eba8b363fb51b448218185cb0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 27 Feb 2014 09:59:19 +0100 Subject: [PATCH] Fix staging check output. --- osc-staging.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/osc-staging.py b/osc-staging.py index b0216b71..ec6654dd 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -183,8 +183,27 @@ def do_staging(self, subcmd, opts, *args): # call the respective command and parse args by need if cmd in ['check']: + # FIXME: de-duplicate and use function when cleaning up this file if len(args) > 1: - return api.check_project_status(api.prj_from_letter(args[1]), verbose=True) + prj = api.prj_from_letter(args[1]) + state = api.check_project_status(prj, True) + + # If the state is green we do nothing + if not state: + print('Skipping empty staging project: {0}'.format(prj)) + print('') + return True + + print('Checking staging project: {0}'.format(prj)) + if type(state) is list: + print(' -- Project still neeeds attention') + for i in state: + print(i) + else: + print(' ++ Acceptable staging project') + + return True + for prj in api.get_staging_projects(): state = api.check_project_status(prj)