From 12a9185b509faf1b208fd8d57c176fdac902f589 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 22 Jul 2015 17:18:08 -0700 Subject: [PATCH] Bump to 0.2.2 --- minio/__version__.py | 2 +- minio/helpers.py | 2 +- minio/minio.py | 15 ++++++++------- minio/xml_requests.py | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/minio/__version__.py b/minio/__version__.py index 547ce8d83..ed6d45d10 100644 --- a/minio/__version__.py +++ b/minio/__version__.py @@ -17,7 +17,7 @@ # (major, minor, micro, alpha/beta/rc/final, #) # (1, 1, 2, 'alpha', 0) => "1.1.2.dev" # (1, 2, 0, 'beta', 2) => "1.2b2" -version_info = (0, 2, 2, 'alpha', 0) +version_info = (0, 2, 2, 'final', 0) def get_version(): " Returns a PEP 386-compliant version number from version_info. " diff --git a/minio/helpers.py b/minio/helpers.py index f81ad97f7..2acab2fb8 100644 --- a/minio/helpers.py +++ b/minio/helpers.py @@ -156,7 +156,7 @@ def get_sha256(content): hasher.update(content) return hasher.digest() -def get_md5(cntoent): +def get_md5(content): """ calculate md5 for given content """ diff --git a/minio/minio.py b/minio/minio.py index 78245cb18..1d4ac57e1 100644 --- a/minio/minio.py +++ b/minio/minio.py @@ -317,7 +317,8 @@ def drop_all_incomplete_uploads(self, bucket): # check bucket is_valid_bucket_name(bucket) - uploads = ListIncompleteUploads(self._http, self._endpoint_url, bucket, None, + uploads = ListIncompleteUploads(self._http, self._endpoint_url, + bucket, None, access_key=self._access_key, secret_key=self._secret_key) @@ -383,7 +384,7 @@ def get_partial_object(self, bucket, key, offset=0, length=0): return DataStreamer(response) - def put_object(self, bucket, key, data, length=0, + def put_object(self, bucket, key, length, data, content_type="application/octet-stream"): """ Add a new object to the object storage server. @@ -391,12 +392,12 @@ def put_object(self, bucket, key, data, length=0, Data can either be a string, byte array, or reader (e.g. open('foo')) Examples: - minio.put('foo', 'bar', 'hello world', 11) + minio.put('foo', 'bar', 11, 'hello world') - minio.put('foo', 'bar', b'hello world', 11, 'text/plain') + minio.put('foo', 'bar', 11, b'hello world', 'text/plain') with open('hello.txt', 'rb') as data: - minio.put('foo', 'bar', b'hello world', 11, 'text/plain') + minio.put('foo', 'bar', 11, b'hello world', 'text/plain') :param bucket: Bucket of new object. :param key: Key of new object. @@ -461,8 +462,8 @@ def list_objects(self, bucket, prefix=None, recursive=False): :return: An iterator of objects in alphabetical order. """ is_valid_bucket_name(bucket) - return ListObjectsIterator(self._http, self._endpoint_url, bucket, prefix, - recursive, self._access_key, + return ListObjectsIterator(self._http, self._endpoint_url, bucket, + prefix, recursive, self._access_key, self._secret_key) def stat_object(self, bucket, key): diff --git a/minio/xml_requests.py b/minio/xml_requests.py index 47eeb9e90..47c4ca316 100644 --- a/minio/xml_requests.py +++ b/minio/xml_requests.py @@ -38,4 +38,4 @@ def generate_complete_multipart_upload(etags): etag.text = etags[i] data = BytesIO() ElementTree.ElementTree(root).write(data, encoding=None, xml_declaration=False) - return data.getvalue() + return data.getvalue()