PR#3576: kojivmd: improve topurl example and error handling

Merges #3576
https://pagure.io/koji/pull-request/3576
This commit is contained in:
Tomas Kopecek 2022-11-09 09:40:39 +01:00
commit e9b5ec215d
2 changed files with 2 additions and 1 deletions

View file

@ -715,6 +715,7 @@ class VMExecTask(BaseTaskHandler):
koji.ensuredir(os.path.dirname(localpath))
# closing needs to be used for requests < 2.18.0
with closing(requests.get(remote_url, stream=True)) as response:
response.raise_for_status()
with open(localpath, 'wb') as f:
for chunk in response.iter_content(chunk_size=65536):
f.write(chunk)

View file

@ -15,7 +15,7 @@
; workdir=/tmp/koji
; The url where the Koji root directory (/mnt/koji) can be accessed
topurl=http://koji.example.com/kojiroot
topurl=http://koji.example.com/kojifiles
; The URL for the xmlrpc server
server=http://hub.example.com/kojihub