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
d89d2432
Commit
d89d2432
authored
Mar 28, 2014
by
Cristian Ciupitu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix for gc_storage and s3
Make keysum return None if not key_check (this case wasn't covered).
parent
e6ab2d83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
library/cloud/gc_storage
+6
-5
library/cloud/s3
+6
-5
No files found.
library/cloud/gc_storage
View file @
d89d2432
...
...
@@ -152,11 +152,12 @@ def key_check(module, gs, bucket, obj):
def
keysum
(
module
,
gs
,
bucket
,
obj
):
bucket
=
gs
.
lookup
(
bucket
)
key_check
=
bucket
.
get_key
(
obj
)
if
key_check
:
md5_remote
=
key_check
.
etag
[
1
:
-
1
]
etag_multipart
=
'-'
in
md5_remote
# Check for multipart, etag is not md5
if
etag_multipart
is
True
:
module
.
fail_json
(
msg
=
"Files uploaded with multipart of gs are not supported with checksum, unable to compute checksum."
)
if
not
key_check
:
return
None
md5_remote
=
key_check
.
etag
[
1
:
-
1
]
etag_multipart
=
'-'
in
md5_remote
# Check for multipart, etag is not md5
if
etag_multipart
is
True
:
module
.
fail_json
(
msg
=
"Files uploaded with multipart of gs are not supported with checksum, unable to compute checksum."
)
return
md5_remote
def
bucket_check
(
module
,
gs
,
bucket
):
...
...
library/cloud/s3
View file @
d89d2432
...
...
@@ -145,11 +145,12 @@ def key_check(module, s3, bucket, obj):
def
keysum
(
module
,
s3
,
bucket
,
obj
):
bucket
=
s3
.
lookup
(
bucket
)
key_check
=
bucket
.
get_key
(
obj
)
if
key_check
:
md5_remote
=
key_check
.
etag
[
1
:
-
1
]
etag_multipart
=
'-'
in
md5_remote
# Check for multipart, etag is not md5
if
etag_multipart
is
True
:
module
.
fail_json
(
msg
=
"Files uploaded with multipart of s3 are not supported with checksum, unable to compute checksum."
)
if
not
key_check
:
return
None
md5_remote
=
key_check
.
etag
[
1
:
-
1
]
etag_multipart
=
'-'
in
md5_remote
# Check for multipart, etag is not md5
if
etag_multipart
is
True
:
module
.
fail_json
(
msg
=
"Files uploaded with multipart of s3 are not supported with checksum, unable to compute checksum."
)
return
md5_remote
def
bucket_check
(
module
,
s3
,
bucket
):
...
...
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