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
fb903c53
Commit
fb903c53
authored
Nov 12, 2013
by
James Tanner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change s3 module to use shared ec2 authorization module snippet
parent
06eb7357
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
17 deletions
+5
-17
library/cloud/s3
+5
-17
No files found.
library/cloud/s3
View file @
fb903c53
...
...
@@ -272,9 +272,9 @@ def main():
mode
=
module
.
params
.
get
(
'mode'
)
expiry
=
int
(
module
.
params
[
'expiry'
])
s3_url
=
module
.
params
.
get
(
's3_url'
)
aws_secret_key
=
module
.
params
.
get
(
'aws_secret_key'
)
aws_access_key
=
module
.
params
.
get
(
'aws_access_key'
)
overwrite
=
module
.
params
.
get
(
'overwrite'
)
ec2_url
,
aws_access_key
,
aws_secret_key
,
region
=
get_ec2_creds
(
module
)
if
module
.
params
.
get
(
'object'
):
obj
=
os
.
path
.
expanduser
(
module
.
params
[
'object'
])
...
...
@@ -283,18 +283,6 @@ def main():
if
not
s3_url
and
'S3_URL'
in
os
.
environ
:
s3_url
=
os
.
environ
[
'S3_URL'
]
if
not
aws_secret_key
:
if
'AWS_SECRET_KEY'
in
os
.
environ
:
aws_secret_key
=
os
.
environ
[
'AWS_SECRET_KEY'
]
elif
'EC2_SECRET_KEY'
in
os
.
environ
:
aws_secret_key
=
os
.
environ
[
'EC2_SECRET_KEY'
]
if
not
aws_access_key
:
if
'AWS_ACCESS_KEY'
in
os
.
environ
:
aws_access_key
=
os
.
environ
[
'AWS_ACCESS_KEY'
]
elif
'EC2_ACCESS_KEY'
in
os
.
environ
:
aws_access_key
=
os
.
environ
[
'EC2_ACCESS_KEY'
]
# If we have an S3_URL env var set, this is likely to be Walrus, so change connection method
if
is_walrus
(
s3_url
):
try
:
...
...
@@ -463,8 +451,8 @@ def main():
module
.
exit_json
(
failed
=
False
)
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
# import module snippets
from
ansible.module_utils.basic
import
*
from
ansible.module_utils.ec2
import
*
main
()
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