Skip to content

Commit

Permalink
use group id in case the security group is in vpc
Browse files Browse the repository at this point in the history
  • Loading branch information
AmineChikhaoui committed May 19, 2017
1 parent d4ac7d5 commit 0fec83d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nixops/resources/ec2_security_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def create(self, defn, check, allow_reboot, allow_recreate):
self._connect()

try:
grp = self._conn.get_all_security_groups([ defn.security_group_name ])[0]
if self.vpc_id:
grp = self._conn.get_all_security_groups([ defn.security_group_id ])[0]
else:
grp = self._conn.get_all_security_groups([ defn.security_group_name ])[0]
self.state = self.UP
self.security_group_id = grp.id
self.security_group_description = grp.description
Expand Down

0 comments on commit 0fec83d

Please sign in to comment.