forked from adamm/git-importer
Revert "Try to fetch the element as deleted if initial access failed"
The OBS api has been fixed to provide an automatic fallback via
https://github.com/openSUSE/open-build-service/pull/15655
This reverts commit c9e07e536f
.
This commit is contained in:
parent
b0ffb01c59
commit
d0ccf83684
26
lib/obs.py
26
lib/obs.py
@ -148,28 +148,12 @@ class OBS:
|
|||||||
]
|
]
|
||||||
|
|
||||||
def _download(self, project, package, name, revision):
|
def _download(self, project, package, name, revision):
|
||||||
# the object might be deleted but we can only pass deleted=1
|
|
||||||
# if it is actually deleted
|
|
||||||
deleted = 0
|
|
||||||
while deleted < 2:
|
|
||||||
url = osc.core.makeurl(
|
|
||||||
self.url,
|
|
||||||
["source", project, package, urllib.parse.quote(name)],
|
|
||||||
{"rev": revision, "expand": 1, "deleted": deleted if deleted else ()},
|
|
||||||
)
|
|
||||||
try:
|
|
||||||
osc.core.http_request("HEAD", url)
|
|
||||||
break
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
deleted += 1
|
|
||||||
|
|
||||||
url = osc.core.makeurl(
|
url = osc.core.makeurl(
|
||||||
self.url,
|
self.url,
|
||||||
["source", project, package, urllib.parse.quote(name)],
|
["source", project, package, urllib.parse.quote(name)],
|
||||||
{"rev": revision, "expand": 1, "deleted": 1 if deleted else ()},
|
{"rev": revision, "expand": 1},
|
||||||
)
|
)
|
||||||
return osc.core.http_request("GET", url)
|
return osc.core.http_GET(url)
|
||||||
|
|
||||||
def download(
|
def download(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user