Skip to content

Commit

Permalink
fixing bug where supplying a subnet would still send a groupName to A…
Browse files Browse the repository at this point in the history
…WS, which is invalid.
  • Loading branch information
Freedom Dumlao authored and Freedom Dumlao committed Feb 19, 2017
1 parent ef865ba commit 759e2e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions beeswithmachineguns/bees.py
Expand Up @@ -120,9 +120,7 @@ def _get_security_group_id(connection, security_group_name, subnet):
print('The bees need a security group to run under. The one specified was not found.')
return

group = security_groups[0] if security_groups else None

return group.id
return security_groups[0].id if security_groups else None

# Methods

Expand Down Expand Up @@ -209,14 +207,16 @@ def up(count, group, zone, image_id, instance_type, username, key_name, subnet,
min_count=count,
max_count=count,
key_name=key_name,
security_group_ids=[groupId],
security_group_ids=[groupId] if not subnet else None,
instance_type=instance_type,
placement=placement,
subnet_id=subnet)

except boto.exception.EC2ResponseError as e:
print(("Unable to call bees:", e.message))
print("Is your sec group available in this region?")
print(subnet)
print(groupId)
return e

instances = reservation.instances
Expand Down

0 comments on commit 759e2e5

Please sign in to comment.