From 143e9484a7d66403a15cf5fd4b5927d7f4cb75a7 Mon Sep 17 00:00:00 2001 From: Nikos Skalkotos Date: Wed, 25 Apr 2012 18:34:07 +0300 Subject: [PATCH] Add new line in metadata and md5sum string --- image_creator/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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') -- 1.7.10.4