server/lib/deltacloud/drivers/ec2/ec2_driver.rb
def firewall_rule_id(user_id, protocol, from_port, to_port, sources)
          sources_string = ""
          sources.each do |source|
          if source[:type].to_s == "group"
            sources_string << "@#{source[:type]},#{source[:owner]},#{source[:name]},"
          else
            sources_string << "@#{source[:type]},#{source[:family]},#{source[:address]},#{source[:prefix]},"
          end
        end
         #sources_string is @group,297467797945,test@address,ipv4,10.1.1.1,24 etc
         id_string = "#{user_id}~#{protocol}~#{from_port}~#{to_port}~#{sources_string.chomp!(",")}"
#sources_string.slice(0,sources_string.length-1)}"
        end
#generate uid from firewall rule parameters (amazon doesn't do this for us
generate uid from firewall rule parameters (amazon doesn't do this for us
generate uid from firewall rule parameters ( amazon doesn ' t do this for us
def firewall_rule_id(user_id, protocol, from_port, to_port, sources)
          sources_string = ""
          sources.each do |source|
          if source[:type].to_s == "group"
            sources_string << "@#{source[:type]},#{source[:owner]},#{source[:name]},"
          else
            sources_string << "@#{source[:type]},#{source[:family]},#{source[:address]},#{source[:prefix]},"
          end
        end
         id_string = "#{user_id}~#{protocol}~#{from_port}~#{to_port}~#{sources_string.chomp!(",")}"
        end
def firewall_rule_id ( user_id , protocol , from_port , to_port , sources ) sources_string = "" sources . each do | source | if source [ :type ] . to_s == "group" sources_string << "@#{source[:type]},#{source[:owner]},#{source[:name]}," else sources_string << "@#{source[:type]},#{source[:family]},#{source[:address]},#{source[:prefix]}," end end id_string = "#{user_id}~#{protocol}~#{from_port}~#{to_port}~#{sources_string.chomp!(",")}" end
generate uid from firewall rule parameters (amazon doesn't do this for us
generate uid from firewall rule parameters ( amazon doesn ' t do this for us
#sources_string is @group,297467797945,test@address,ipv4,10.1.1.1,24 etc #sources_string.slice(0,sources_string.length-1)}"
user_id
protocol
from_port
to_port
sources