Commit 67033297 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Use default content type when uploading images

Fix a bug were the content type of the image during uploading was
defined as "Calculating block hashes".
parent 052322a6
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2015 GRNET S.A.
# Copyright (C) 2011-2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -176,7 +176,7 @@ def upload_image(session):
with image.raw_device() as raw:
with open(raw, 'rb') as f:
cloud["uploaded"] = \
kamaki.upload(f, image.size, name, container,
kamaki.upload(f, image.size, name, container, None,
"Calculating block hashes",
"Uploading missing blocks")
# Upload md5sum file
......
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2015 GRNET S.A.
# Copyright (C) 2011-2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -477,9 +477,10 @@ def create_image(session, answers):
time.strftime("%Y%m%d%H%M"))
with image.raw_device() as raw:
with open(raw, 'rb') as device:
remote = kamaki.upload(device, image.size, name, CONTAINER,
"(1/3) Calculating block hashes",
"(2/3) Uploading image blocks")
remote = kamaki.upload(
device, image.size, name, CONTAINER, None,
"(1/3) Calculating block hashes",
"(2/3) Uploading image blocks")
image.out.info("(3/3) Uploading md5sum file ...", False)
md5sumstr = '%s %s\n' % (session['checksum'], name)
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2015 GRNET S.A.
# Copyright (C) 2011-2016 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -448,9 +448,10 @@ def image_creator(options, out):
with image.raw_device() as raw:
with open(raw, 'rb') as f:
remote = kamaki.upload(
f, image.size, options.upload, options.container,
"(1/3) Calculating block hashes",
"(2/3) Uploading missing blocks")
f, image.size, options.upload,
options.container, None,
"(1/3) Calculating block hashes",
"(2/3) Uploading missing blocks")
out.info("(3/3) Uploading md5sum file ...", False)
md5sumstr = '%s %s\n' % (checksum,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment