Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
configuration
Commits
9c67396b
Commit
9c67396b
authored
8 years ago
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always expect dicts for the tags param.
parent
6697cb1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
playbooks/library/ec2_lookup
+10
-13
No files found.
playbooks/library/ec2_lookup
View file @
9c67396b
...
...
@@ -96,30 +96,27 @@ def main():
aws_secret_key
=
dict
(
aliases
=
[
'ec2_secret_key'
,
'secret_key'
],
no_log
=
True
),
aws_access_key
=
dict
(
aliases
=
[
'ec2_access_key'
,
'access_key'
]),
tags
=
dict
(
default
=
None
),
tags
=
dict
(
default
=
None
,
type
=
'dict'
),
)
)
tags_param
=
module
.
params
.
get
(
'tags'
)
import
pprint
debug_msg
=
"Before: tags_param type: {} - value: {}"
.
format
(
type
(
tags_param
),
pprint
.
pformat
(
tags_param
))
module
.
log
(
debug_msg
)
#
import pprint
#
debug_msg = "Before: tags_param type: {} - value: {}".format(type(tags_param), pprint.pformat(tags_param))
#
module.log(debug_msg)
if
isinstance
(
tags_param
,
basestring
):
tags_param
=
eval
(
tags_param
)
#
if isinstance(tags_param, basestring):
#
tags_param = eval(tags_param)
debug_msg
+=
" - After: tags_param type: {} - value: {}"
.
format
(
type
(
tags_param
),
pprint
.
pformat
(
tags_param
))
module
.
log
(
debug_msg
)
#
debug_msg += " - After: tags_param type: {} - value: {}".format(type(tags_param), pprint.pformat(tags_param))
#
module.log(debug_msg)
tags
=
{}
if
isinstance
(
tags_param
,
list
):
for
item
in
tags_param
:
tags
.
update
(
item
)
elif
isinstance
(
tags_param
,
dict
):
if
isinstance
(
tags_param
,
dict
):
tags
=
tags_param
else
:
module
.
fail_json
(
msg
=
"Invalid format for tags.
{}"
.
format
(
debug_msg
)
)
module
.
fail_json
(
msg
=
"Invalid format for tags.
"
)
aws_secret_key
=
module
.
params
.
get
(
'aws_secret_key'
)
...
...
This diff is collapsed.
Click to expand it.
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