Commit 4755bde2 by Andres Silva

adding for loop on list to to handle the return of none when the list is empty.…

adding for loop on list to to handle the return of none when the list is empty. With the previous method if the list was empty the script died. See http://stackoverflow.com/questions/18852324/typeerror-sequence-item-0-expected-string-nonetype-found
parent 57d2622c
...@@ -622,8 +622,8 @@ class Ec2Inventory(object): ...@@ -622,8 +622,8 @@ class Ec2Inventory(object):
for group in value: for group in value:
group_ids.append(group.id) group_ids.append(group.id)
group_names.append(group.name) group_names.append(group.name)
instance_vars["ec2_security_group_ids"] = ','.join(group_ids) instance_vars["ec2_security_group_ids"] = ','.join([str(i) for i in group_ids])
instance_vars["ec2_security_group_names"] = ','.join(group_names) instance_vars["ec2_security_group_names"] = ','.join([str(i) for i in group_names])
else: else:
pass pass
# TODO Product codes if someone finds them useful # TODO Product codes if someone finds them useful
......
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