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
6de13c30
Commit
6de13c30
authored
Sep 10, 2015
by
Benno Joy
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11818 from Java1Guy/module_utils_ec2_for_ecs
change ec2 util to create only requested objects
parents
ee7905c7
437d4def
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lib/ansible/module_utils/ec2.py
+5
-3
No files found.
lib/ansible/module_utils/ec2.py
View file @
6de13c30
...
...
@@ -25,6 +25,7 @@
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import
os
,
boto3
try
:
from
distutils.version
import
LooseVersion
...
...
@@ -37,14 +38,15 @@ def boto3_conn(module, conn_type=None, resource=None, region=None, endpoint=None
if
conn_type
not
in
[
'both'
,
'resource'
,
'client'
]:
module
.
fail_json
(
msg
=
'There is an issue in the code of the module. You must specify either both, resource or client to the conn_type parameter in the boto3_conn function call'
)
resource
=
boto3
.
session
.
Session
()
.
resource
(
resource
,
region_name
=
region
,
endpoint_url
=
endpoint
,
**
params
)
client
=
resource
.
meta
.
client
if
conn_type
==
'resource'
:
resource
=
boto3
.
session
.
Session
()
.
resource
(
resource
,
region_name
=
region
,
endpoint_url
=
endpoint
,
**
params
)
return
resource
elif
conn_type
==
'client'
:
client
=
boto3
.
session
.
Session
()
.
client
(
resource
,
region_name
=
region
,
endpoint_url
=
endpoint
,
**
params
)
return
client
else
:
resource
=
boto3
.
session
.
Session
()
.
resource
(
resource
,
region_name
=
region
,
endpoint_url
=
endpoint
,
**
params
)
client
=
boto3
.
session
.
Session
()
.
client
(
resource
,
region_name
=
region
,
endpoint_url
=
endpoint
,
**
params
)
return
client
,
resource
def
aws_common_argument_spec
():
...
...
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