From bddcc12c8db84e9a14e207ead083b1b8c793957a Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 9 Jun 2016 13:11:45 +0200 Subject: [PATCH] Fix accept logic to actually work --- osc-staging.py | 2 +- osclib/stagingapi.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osc-staging.py b/osc-staging.py index 7e644f62..2ece7453 100644 --- a/osc-staging.py +++ b/osc-staging.py @@ -191,7 +191,7 @@ def do_staging(self, subcmd, opts, *args): # Is it safe to accept? Meaning: /totest contains what it should and is not dirty version_totest = api.get_binary_version(api.project, "openSUSE-release.rpm", repository="totest", arch="x86_64") - if version_totest or opts.force: + if version_totest is None or opts.force: # SLE does not have a totest_version or openqa_version - ignore it version_openqa = version_totest totest_dirty = False diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index 2d19b562..f01fba2f 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -1049,8 +1049,10 @@ class StagingAPI(object): url = self.makeurl(['build', project, repository, arch, '_repository', "%s?view=fileinfo" % rpm]) try: return ET.parse(http_GET(url)).getroot().find('version').text - except urllib2.HTTPError: - return None + except urllib2.HTTPError, e: + if e.code == 404: + return None + raise def load_file_content(self, project, package, filename): """