Commit 6697cb1b by John Eskew

Evaluate tags returned as strings.

parent 08ee464f
...@@ -103,14 +103,19 @@ def main(): ...@@ -103,14 +103,19 @@ def main():
tags_param = module.params.get('tags') tags_param = module.params.get('tags')
import pprint import pprint
debug_msg = "tags_param type: {} - value: {}".format(type(tags_param), pprint.pformat(tags_param)) 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)
debug_msg += " - After: tags_param type: {} - value: {}".format(type(tags_param), pprint.pformat(tags_param))
module.log(debug_msg) module.log(debug_msg)
tags = {} tags = {}
if isinstance(tags_param, list): if isinstance(tags_param, list):
for item in module.params.get('tags'): for item in tags_param:
for k,v in item.iteritems(): tags.update(item)
tags[k] = v
elif isinstance(tags_param, dict): elif isinstance(tags_param, dict):
tags = tags_param tags = tags_param
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment