Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
kamaki
Commits
6aadd6e1
Commit
6aadd6e1
authored
May 21, 2013
by
Stavros Sachtouris
Browse files
Do not unpublish by default @ pithos rest calls
Refs: #3780
parent
4a469d38
Changes
3
Hide whitespace changes
Inline
Side-by-side
Changelog
View file @
6aadd6e1
...
...
@@ -7,6 +7,7 @@ Bug Fixes:
- Restore 2nd level command syntax in shell [#3736]
- Allow copy of deleted objects by refering to older version [#3737]
- Add image.add_member missing content-length header
- Do not unpublish by default in all pithos low level requests [#3780]
Changes:
...
...
kamaki/clients/pithos/rest_api.py
View file @
6aadd6e1
...
...
@@ -513,7 +513,7 @@ class PithosRestClient(StorageClient):
content_disposition
=
None
,
manifest
=
None
,
permissions
=
None
,
public
=
Fals
e
,
public
=
Non
e
,
metadata
=
None
,
*
args
,
**
kwargs
):
""" Full Pithos+ PUT at object level
...
...
@@ -564,8 +564,7 @@ class PithosRestClient(StorageClient):
{ 'read':[user1, group1, user2, ...],
'write':['user3, group2, group3, ...] }
:param public: (bool) If true, Object is publicly accessible,
if false, not
:param public: (bool) If true, Object is published, False, unpublished
:param metadata: (dict) Optional user defined metadata in the form
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
...
...
@@ -602,7 +601,7 @@ class PithosRestClient(StorageClient):
perms
+=
';'
if
perms
else
''
perms
+=
'%s=%s'
%
(
perm_type
,
','
.
join
(
perm_list
))
self
.
set_header
(
'X-Object-Sharing'
,
perms
)
self
.
set_header
(
'X-Object-Public'
,
public
)
self
.
set_header
(
'X-Object-Public'
,
public
,
public
is
not
None
)
if
metadata
:
for
key
,
val
in
metadata
.
items
():
self
.
set_header
(
'X-Object-Meta-'
+
key
,
val
)
...
...
@@ -623,7 +622,7 @@ class PithosRestClient(StorageClient):
content_disposition
=
None
,
source_version
=
None
,
permissions
=
None
,
public
=
Fals
e
,
public
=
Non
e
,
metadata
=
None
,
*
args
,
**
kwargs
):
""" Full Pithos+ COPY at object level
...
...
@@ -660,7 +659,7 @@ class PithosRestClient(StorageClient):
{ 'read':[user1, group1, user2, ...],
'write':['user3, group2, group3, ...] }
:param public: (bool) If true, Object is publi
cly accessible
:param public: (bool) If true, Object is publi
shed, False, unpublished
:param metadata: (dict) Optional user defined metadata in the form
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
...
...
@@ -692,7 +691,7 @@ class PithosRestClient(StorageClient):
perms
+=
';'
if
perms
else
''
perms
+=
'%s=%s'
%
(
perm_type
,
','
.
join
(
perm_list
))
self
.
set_header
(
'X-Object-Sharing'
,
perms
)
self
.
set_header
(
'X-Object-Public'
,
public
)
self
.
set_header
(
'X-Object-Public'
,
public
,
public
is
not
None
)
if
metadata
:
for
key
,
val
in
metadata
.
items
():
self
.
set_header
(
'X-Object-Meta-'
+
key
,
val
)
...
...
@@ -713,7 +712,7 @@ class PithosRestClient(StorageClient):
content_encoding
=
None
,
content_disposition
=
None
,
permissions
=
{},
public
=
Fals
e
,
public
=
Non
e
,
metadata
=
{},
*
args
,
**
kwargs
):
""" Full Pithos+ COPY at object level
...
...
@@ -750,7 +749,7 @@ class PithosRestClient(StorageClient):
{ 'read':[user1, group1, user2, ...],
'write':['user3, group2, group3, ...] }
:param public: (bool) If true, Object is publi
cly accessible
:param public: (bool) If true, Object is publi
shed, False, unpublished
:param metadata: (dict) Optional user defined metadata in the form
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
...
...
@@ -779,7 +778,7 @@ class PithosRestClient(StorageClient):
perms
+=
';'
if
perms
else
''
perms
+=
'%s=%s'
%
(
perm_type
,
','
.
join
(
perm_list
))
self
.
set_header
(
'X-Object-Sharing'
,
perms
)
self
.
set_header
(
'X-Object-Public'
,
public
)
self
.
set_header
(
'X-Object-Public'
,
public
,
public
is
not
None
)
if
metadata
:
for
key
,
val
in
metadata
.
items
():
self
.
set_header
(
'X-Object-Meta-'
+
key
,
val
)
...
...
@@ -806,7 +805,7 @@ class PithosRestClient(StorageClient):
object_bytes
=
None
,
manifest
=
None
,
permissions
=
{},
public
=
Fals
e
,
public
=
Non
e
,
metadata
=
{},
*
args
,
**
kwargs
):
""" Full Pithos+ POST at object level
...
...
@@ -854,7 +853,7 @@ class PithosRestClient(StorageClient):
{ 'read':[user1, group1, user2, ...],
'write':['user3, group2, group3, ...] }
:param public: (bool) If true, Object is publi
cly accessible
:param public: (bool) If true, Object is publi
shed, False, unpublished
:param metadata: (dict) Optional user defined metadata in the form
{'meta-key-1':'meta-value-1', 'meta-key-2':'meta-value-2', ...}
...
...
@@ -892,7 +891,7 @@ class PithosRestClient(StorageClient):
perms
+=
';'
if
perms
else
''
perms
+=
'%s=%s'
%
(
perm_type
,
','
.
join
(
perm_list
))
self
.
set_header
(
'X-Object-Sharing'
,
perms
)
self
.
set_header
(
'X-Object-Public'
,
public
)
self
.
set_header
(
'X-Object-Public'
,
public
,
public
is
not
None
)
for
key
,
val
in
metadata
.
items
():
self
.
set_header
(
'X-Object-Meta-'
+
key
,
val
)
...
...
kamaki/clients/pithos/test.py
View file @
6aadd6e1
...
...
@@ -1650,13 +1650,13 @@ class PithosClient(TestCase):
read_perms
=
[
'u1'
,
'g1'
,
'u2'
,
'g2'
]
write_perms
=
[
'u1'
,
'g1'
]
for
kwargs
in
(
dict
(
read_permi
t
ion
=
read_perms
,
write_permi
t
ion
=
write_perms
),
dict
(
read_permi
t
ion
=
read_perms
),
dict
(
write_permi
t
ion
=
write_perms
),
dict
(
read_permi
ss
ion
=
read_perms
,
write_permi
ss
ion
=
write_perms
),
dict
(
read_permi
ss
ion
=
read_perms
),
dict
(
write_permi
ss
ion
=
write_perms
),
dict
()):
self
.
client
.
set_object_sharing
(
obj
,
**
kwargs
)
kwargs
[
'read'
]
=
kwargs
.
pop
(
'read_permi
t
ion'
,
''
)
kwargs
[
'write'
]
=
kwargs
.
pop
(
'write_permi
t
ion'
,
''
)
kwargs
[
'read'
]
=
kwargs
.
pop
(
'read_permi
ss
ion'
,
''
)
kwargs
[
'write'
]
=
kwargs
.
pop
(
'write_permi
ss
ion'
,
''
)
self
.
assertEqual
(
OP
.
mock_calls
[
-
1
],
call
(
obj
,
update
=
True
,
permissions
=
kwargs
))
...
...
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