From 09ca449eabc94e9d9c740d32f39542c5f01ea17e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 4 Mar 2021 09:02:43 -0500 Subject: [PATCH] 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. --- confluent_server/confluent/osimage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 63bdd23d..3245e0f3 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -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))