From 9d0725b2d412061b476a1ea014f22b714c51f391 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Fri, 10 Mar 2017 11:08:31 +0100 Subject: [PATCH] Fix local service run for non-existent (server-side) package If a package does not exist on the server, the Serviceinfo.getProjectGlobalServices call results in a 404. In this case, we try it again with the _project package (note: this does not take potential "linked" services into account, if the local package is a _link). Fixes: #277 ("404 on running service for non commited package") --- osc/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osc/core.py b/osc/core.py index 5b668fc4..43f83113 100644 --- a/osc/core.py +++ b/osc/core.py @@ -308,7 +308,10 @@ class Serviceinfo: self.project = project self.package = package except HTTPError as e: - if e.code != 403 and e.code != 400: + if e.code == 404 and package != '_project': + self.getProjectGlobalServices(apiurl, project, '_project') + self.package = package + elif e.code != 403 and e.code != 400: raise e def addVerifyFile(self, serviceinfo_node, filename):