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
synnefo
Commits
87e6c33a
Commit
87e6c33a
authored
Sep 12, 2013
by
Sofia Papagiannaki
Browse files
pithos: Acquire locks in alphabetical path order in copy object
parent
6d093712
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-pithos-backend/pithos/backends/modular.py
View file @
87e6c33a
...
...
@@ -1064,8 +1064,18 @@ class ModularBackend(BaseBackend):
dest_meta
=
dest_meta
or
{}
dest_version_ids
=
[]
self
.
_can_read
(
user
,
src_account
,
src_container
,
src_name
)
path
,
node
=
self
.
_lookup_object
(
src_account
,
src_container
,
src_name
,
lock_container
=
True
)
src_container_path
=
'/'
.
join
((
src_account
,
src_container
))
dest_container_path
=
'/'
.
join
((
dest_account
,
dest_container
))
# Lock container paths in alphabetical order
if
src_container_path
<
dest_container_path
:
self
.
_lookup_container
(
src_account
,
src_container
)
self
.
_lookup_container
(
dest_account
,
dest_container
)
else
:
self
.
_lookup_container
(
dest_account
,
dest_container
)
self
.
_lookup_container
(
src_account
,
src_container
)
path
,
node
=
self
.
_lookup_object
(
src_account
,
src_container
,
src_name
)
# TODO: Will do another fetch of the properties in duplicate version...
props
=
self
.
_get_version
(
node
,
src_version
)
# Check to see if source exists.
...
...
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