Skip to content

Commit

Permalink
changed cluster and facet groups to use server.security_group instead…
Browse files Browse the repository at this point in the history
… of cloud.security group
  • Loading branch information
Chris Howe committed Jan 17, 2014
1 parent c72a466 commit 0ed441a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/ironfan/provider/ec2/security_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.resource_type() :security_group; end
def self.expected_ids(computer)
return unless computer.server
ec2 = computer.server.cloud(:ec2)
ec2.security_groups.keys.map { |name| group_name_with_vpc(name,ec2.vpc) }.uniq

server_groups = computer.server.security_groups
cloud_groups = ec2.security_groups

Expand Down Expand Up @@ -197,11 +197,11 @@ def self.ensure_groups(computer)
# FIXME: This violates the DSL's immutability; it should be
# something calculated from within the DSL construction
Ironfan.todo("CODE SMELL: violation of DSL immutability: #{caller}")
cloud = computer.server.cloud(:ec2)
c_group = cloud.security_group(computer.server.cluster_name)
server = computer.server
c_group = server.security_group(computer.server.cluster_name)
c_group.authorized_by_group(c_group.name)
facet_name = "#{computer.server.cluster_name}-#{computer.server.facet_name}"
cloud.security_group(facet_name)
server.security_group(facet_name)
end

# Try an authorization, ignoring duplicates (this is easier than correlating).
Expand Down
6 changes: 3 additions & 3 deletions lib/ironfan/provider/openstack/security_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ def self.ensure_groups(computer)
# FIXME: This violates the DSL's immutability; it should be
# something calculated from within the DSL construction
Ironfan.todo("CODE SMELL: violation of DSL immutability: #{caller}")
cloud = computer.server.cloud(:openstack)
c_group = cloud.security_group(computer.server.cluster_name)
server = computer.server
c_group = server.security_group(computer.server.cluster_name)
c_group.authorized_by_group(c_group.name)
facet_name = "#{computer.server.cluster_name}-#{computer.server.facet_name}"
cloud.security_group(facet_name)
server.security_group(facet_name)
end


Expand Down

0 comments on commit 0ed441a

Please sign in to comment.