Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
0c275424
Commit
0c275424
authored
Oct 22, 2013
by
bennojoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix to work like copy module
parent
788e783b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
library/cloud/gc_storage
+3
-3
No files found.
library/cloud/gc_storage
View file @
0c275424
...
...
@@ -263,7 +263,7 @@ def get_download_url(module, gs, bucket, obj, expiry):
def
handle_get
(
module
,
gs
,
bucket
,
obj
,
overwrite
,
dest
):
md5_remote
=
keysum
(
module
,
gs
,
bucket
,
obj
)
md5_local
=
hashlib
.
md5
(
open
(
dest
,
'rb'
)
.
read
())
.
hexdigest
()
if
md5_local
==
md5_remote
and
not
overwrite
:
if
md5_local
==
md5_remote
:
module
.
exit_json
(
changed
=
False
)
if
md5_local
!=
md5_remote
and
not
overwrite
:
module
.
exit_json
(
msg
=
"WARNING: Checksums do not match. Use overwrite parameter to force download."
,
failed
=
True
)
...
...
@@ -279,8 +279,8 @@ def handle_put(module, gs, bucket, obj, overwrite, src, expiration):
if
bucket_rc
and
key_rc
:
md5_remote
=
keysum
(
module
,
gs
,
bucket
,
obj
)
md5_local
=
hashlib
.
md5
(
open
(
src
,
'rb'
)
.
read
())
.
hexdigest
()
if
md5_local
==
md5_remote
and
not
overwrite
:
module
.
exit_json
(
msg
=
"Local and remote object are identical
. Use overwrite to force upload
"
,
changed
=
False
)
if
md5_local
==
md5_remote
:
module
.
exit_json
(
msg
=
"Local and remote object are identical"
,
changed
=
False
)
if
md5_local
!=
md5_remote
and
not
overwrite
:
module
.
exit_json
(
msg
=
"WARNING: Checksums do not match. Use overwrite parameter to force upload."
,
failed
=
True
)
else
:
...
...
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