2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-15 12:17:47 +00:00

Fix iso import distinfo.yaml

If a copy method (e.g. ubuntu) is used, then distinfo.yaml is not
written. Fix by not overwriting the directory name.
This commit is contained in:
Jarrod Johnson 2021-03-04 09:02:43 -05:00
parent d08ce9e563
commit 09ca449eab

View File

@ -517,9 +517,9 @@ def import_image(filename, callback, backend=False, mfd=None):
extract_file(archive, callback=callback, imginfo=imginfo, extractlist=identity.get('extractlist', None))
if COPY & identity['method']:
basename = identity.get('copyto', os.path.basename(filename))
targpath = os.path.join(targpath, basename)
targiso = os.path.join(targpath, basename)
archive.seek(0)
with open(targpath, 'wb') as targ:
with open(targiso, 'wb') as targ:
shutil.copyfileobj(archive, targ)
with open(targpath + '/distinfo.yaml', 'w') as distinfo:
distinfo.write(yaml.dump(identity, default_flow_style=False))