PR#1618: write binary data to ks file

Merges #1618
https://pagure.io/koji/pull-request/1618

Fixes: #1617
https://pagure.io/koji/issue/1617
fetching kickstart fails on binary vs str under py 3
This commit is contained in:
Tomas Kopecek 2019-08-28 15:16:25 +02:00
commit 22e606bd1e

View file

@ -3544,7 +3544,7 @@ class OzImageTask(BaseTaskHandler):
tops['tempdir'] = self.workdir
with koji.openRemoteFile(ksfile, **tops) as ks_src:
kspath = os.path.join(self.workdir, os.path.basename(ksfile))
with open(kspath, 'w') as ks_dest:
with open(kspath, 'wb') as ks_dest:
ks_dest.write(ks_src.read())
self.logger.debug('uploading kickstart from here: %s' % kspath)
self.uploadFile(kspath) # upload the original ks file