From a536ef5e6412e366a59053a2ce9fd534f7ea9a85 Mon Sep 17 00:00:00 2001 From: ssedlmaier Date: Fri, 9 Sep 2016 14:46:28 +0200 Subject: [PATCH] get_package_results: check actual package status At the moment only the project status is taken into account when determining when to stop watching a build. This leads to wrong behavior when a package is in 'blocked' for a longer time. In this state the project status and code is 'published' but the package remains at 'blocked'. With this additional check this problem is fixed. --- osc/core.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osc/core.py b/osc/core.py index 47330369..b1eb2f8f 100644 --- a/osc/core.py +++ b/osc/core.py @@ -5536,7 +5536,12 @@ def get_package_results(apiurl, project, package, wait=False, *args, **kwargs): elif result.get('code') in waiting_states: waiting = True break - + else: + pkg = result.find('status') + if pkg.get('code') in waiting_states: + waiting = True + break + if not wait or not waiting: break else: