Method: Beaker::OpenStack#security_groups

Defined in:
lib/beaker/hypervisor/openstack.rb

#security_groups(sgs) ⇒ Array

Provided an array of security groups return that array if all security groups are present

Parameters:

  • sgs (Array)

    The array of security group names

Returns:

  • (Array)

    The array of security group names



96
97
98
99
100
101
102
# File 'lib/beaker/hypervisor/openstack.rb', line 96

def security_groups sgs
  for sg in sgs
    @logger.debug "Openstack: Looking up security group '#{sg}'"
    @compute_client.security_groups.find { |x| x.name == sg } || raise("Couldn't find security group: #{sg}")
    sgs
  end
end