From: Nikos Skalkotos Date: Wed, 25 Apr 2012 15:34:07 +0000 (+0300) Subject: Add new line in metadata and md5sum string X-Git-Tag: v0.1~99 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/143e9484a7d66403a15cf5fd4b5927d7f4cb75a7 Add new line in metadata and md5sum string --- diff --git a/image_creator/main.py b/image_creator/main.py index 4a289c5..26a6675 100755 --- a/image_creator/main.py +++ b/image_creator/main.py @@ -197,8 +197,9 @@ def image_creator(): checksum = md5(snapshot, size) - metastring = "\n".join( + metastring = '\n'.join( ['%s=%s' % (key, value) for (key, value) in metadata.items()]) + metastring += '\n' if options.outfile is not None: dev.dump(options.outfile) @@ -210,7 +211,7 @@ def image_creator(): output('Dumping md5sum file...', False) with open('%s.%s' % (options.outfile, 'md5sum'), 'w') as f: - f.write('%s %s' % ( + f.write('%s %s\n' % ( checksum, os.path.basename(options.outfile))) success('done') @@ -233,7 +234,8 @@ def image_creator(): remote_path="%s.%s" % (options.upload, 'meta')) success('done') output("(4/4) Uploading md5sum file...", False) - md5sumstr = '%s %s' % (checksum, os.path.basename(options.upload)) + md5sumstr = '%s %s\n' % ( + checksum, os.path.basename(options.upload)) kamaki.upload(StringIO.StringIO(md5sumstr), size=len(md5sumstr), remote_path="%s.%s" % (options.upload, 'md5sum')) success('done')