Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kamaki
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
kamaki
Commits
bc549992
Commit
bc549992
authored
Jun 05, 2015
by
Nikos Skalkotos
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into develop
Conflicts: kamaki/version.py version
parents
03a41be8
43312fd2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
17 deletions
+49
-17
Changelog
Changelog
+15
-0
kamaki/clients/pithos/__init__.py
kamaki/clients/pithos/__init__.py
+21
-8
kamaki/clients/pithos/rest_api.py
kamaki/clients/pithos/rest_api.py
+4
-2
kamaki/clients/pithos/test.py
kamaki/clients/pithos/test.py
+5
-3
kamaki/version.py
kamaki/version.py
+3
-3
version
version
+1
-1
No files found.
Changelog
View file @
bc549992
...
...
@@ -23,6 +23,21 @@ Features
.. _Changelog-0.13:
v0.13.4
=======
Bug Fixes
=========
* Fix Destination headers to support unicode values (pithos object
copy and move)
v0.13.3
=======
Bug Fixes
---------
* Return object request headers in download methods
v0.13.2
=======
...
...
kamaki/clients/pithos/__init__.py
View file @
bc549992
# Copyright 2011-201
4
GRNET S.A. All rights reserved.
# Copyright 2011-201
5
GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
...
...
@@ -754,7 +754,8 @@ class PithosClient(PithosRestClient):
if_match
=
None
,
if_none_match
=
None
,
if_modified_since
=
None
,
if_unmodified_since
=
None
):
if_unmodified_since
=
None
,
headers
=
dict
()):
"""Download an object (multiple connections, random blocks)
:param obj: (str) remote object path
...
...
@@ -775,14 +776,18 @@ class PithosClient(PithosRestClient):
:param if_modified_since: (str) formated date
:param if_unmodified_since: (str) formated date"""
:param if_unmodified_since: (str) formated date
:param headers: (dict) placeholder to gather object headers
"""
restargs
=
dict
(
version
=
version
,
data_range
=
None
if
range_str
is
None
else
'bytes=%s'
%
range_str
,
if_match
=
if_match
,
if_none_match
=
if_none_match
,
if_modified_since
=
if_modified_since
,
if_unmodified_since
=
if_unmodified_since
)
if_unmodified_since
=
if_unmodified_since
,
headers
=
dict
())
(
blocksize
,
...
...
@@ -790,6 +795,7 @@ class PithosClient(PithosRestClient):
total_size
,
hash_list
,
remote_hashes
)
=
self
.
_get_remote_blocks_info
(
obj
,
**
restargs
)
headers
.
update
(
restargs
.
pop
(
'headers'
))
assert
total_size
>=
0
if
download_cb
:
...
...
@@ -829,7 +835,8 @@ class PithosClient(PithosRestClient):
if_match
=
None
,
if_none_match
=
None
,
if_modified_since
=
None
,
if_unmodified_since
=
None
):
if_unmodified_since
=
None
,
headers
=
dict
()):
"""Download an object to a string (multiple connections). This method
uses threads for http requests, but stores all content in memory.
...
...
@@ -849,6 +856,8 @@ class PithosClient(PithosRestClient):
:param if_unmodified_since: (str) formated date
:param headers: (dict) a placeholder dict to gather object headers
:returns: (str) the whole object contents
"""
restargs
=
dict
(
...
...
@@ -857,7 +866,8 @@ class PithosClient(PithosRestClient):
if_match
=
if_match
,
if_none_match
=
if_none_match
,
if_modified_since
=
if_modified_since
,
if_unmodified_since
=
if_unmodified_since
)
if_unmodified_since
=
if_unmodified_since
,
headers
=
dict
())
(
blocksize
,
...
...
@@ -865,6 +875,7 @@ class PithosClient(PithosRestClient):
total_size
,
hash_list
,
remote_hashes
)
=
self
.
_get_remote_blocks_info
(
obj
,
**
restargs
)
headers
.
update
(
restargs
.
pop
(
'headers'
))
assert
total_size
>=
0
if
download_cb
:
...
...
@@ -901,7 +912,7 @@ class PithosClient(PithosRestClient):
for
thread
in
activethreads
():
thread
.
join
()
#Command Progress Bar method
#
Command Progress Bar method
def
_cb_next
(
self
,
step
=
1
):
if
hasattr
(
self
,
'progress_bar_gen'
):
try
:
...
...
@@ -923,7 +934,8 @@ class PithosClient(PithosRestClient):
if_match
=
None
,
if_none_match
=
None
,
if_modified_since
=
None
,
if_unmodified_since
=
None
):
if_unmodified_since
=
None
,
headers
=
dict
()):
"""
:param obj: (str) remote object path
...
...
@@ -950,6 +962,7 @@ class PithosClient(PithosRestClient):
if
err
.
status
==
304
or
err
.
status
==
412
:
return
{}
raise
headers
.
update
(
r
.
headers
)
return
r
.
json
def
set_account_group
(
self
,
group
,
usernames
):
...
...
kamaki/clients/pithos/rest_api.py
View file @
bc549992
...
...
@@ -738,7 +738,8 @@ class PithosRestClient(StorageClient):
'X-Source-Version'
,
]
self
.
response_header_prefices
=
[
'X-Object-'
,
]
self
.
request_header_prefices_to_quote
=
[
'x-object-meta-'
,
]
self
.
request_header_prefices_to_quote
=
[
'x-object-meta-'
,
'Destination'
]
self
.
set_param
(
'format'
,
format
,
iff
=
format
)
self
.
set_param
(
'ignore_content_type'
,
iff
=
ignore_content_type
)
...
...
@@ -838,7 +839,8 @@ class PithosRestClient(StorageClient):
'X-Source-Version'
,
]
self
.
response_header_prefices
=
[
'X-Object-'
,
]
self
.
request_header_prefices_to_quote
=
[
'x-object-meta-'
,
]
self
.
request_header_prefices_to_quote
=
[
'x-object-meta-'
,
'Destination'
]
self
.
set_param
(
'format'
,
format
,
iff
=
format
)
self
.
set_param
(
'ignore_content_type'
,
iff
=
ignore_content_type
)
...
...
kamaki/clients/pithos/test.py
View file @
bc549992
...
...
@@ -1302,15 +1302,17 @@ class PithosClient(TestCase):
if_match
=
'if and only if'
,
if_none_match
=
'if and only not'
,
if_modified_since
=
'what if not?'
,
if_unmodified_since
=
'this happens if not!'
)
if_unmodified_since
=
'this happens if not!'
,
headers
=
dict
())
expargs
=
dict
(
kwargs
)
expargs
.
pop
(
'range_str'
)
for
k
in
expargs
:
expargs
[
k
]
=
None
for
k
,
v
in
expargs
.
items
()
:
expargs
[
k
]
=
None
if
v
else
v
GOH
.
assert_called_once_with
(
obj
,
**
expargs
)
r
=
self
.
client
.
download_to_string
(
obj
,
**
kwargs
)
expargs
[
'data_range'
]
=
'bytes=%s'
%
kwargs
[
'range_str'
]
expargs
.
pop
(
'headers'
)
for
k
,
v
in
expargs
.
items
():
self
.
assertEqual
(
GET
.
mock_calls
[
-
1
][
2
][
k
],
...
...
kamaki/version.py
View file @
bc549992
__version__
=
"0.13.
2
next"
__version__
=
"0.13.
4
next"
__version_vcs_info__
=
{
'branch'
:
'develop'
,
'revid'
:
'
ce8d24b
'
,
'revno'
:
25
06
}
'revid'
:
'
14f2b91
'
,
'revno'
:
25
37
}
__version_user_email__
=
"skalkoto@grnet.gr"
__version_user_name__
=
"Nikos Skalkotos"
version
View file @
bc549992
0.13.
2
next
0.13.
4
next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment