Commit 6373c152 by John Eskew

Removed all fancy tags treatments.

parent b77c4881
...@@ -100,25 +100,6 @@ def main(): ...@@ -100,25 +100,6 @@ def main():
) )
) )
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)
# 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)
tags = {}
if isinstance(tags_param, dict):
tags = tags_param
else:
module.fail_json(msg="Invalid format for tags.")
aws_secret_key = module.params.get('aws_secret_key') aws_secret_key = module.params.get('aws_secret_key')
aws_access_key = module.params.get('aws_access_key') aws_access_key = module.params.get('aws_access_key')
region = module.params.get('region') region = module.params.get('region')
...@@ -144,7 +125,7 @@ def main(): ...@@ -144,7 +125,7 @@ def main():
instances = [] instances = []
instance_ids = [] instance_ids = []
for res in ec2.get_all_instances(filters={'tag:' + tag: value for res in ec2.get_all_instances(filters={'tag:' + tag: value
for tag, value in tags.iteritems()}): for tag, value in module.params.get('tags').iteritems()}):
for inst in res.instances: for inst in res.instances:
if inst.state == "running": if inst.state == "running":
instances.append({k: v for k, v in inst.__dict__.iteritems() instances.append({k: v for k, v in inst.__dict__.iteritems()
......
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