incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sp...@apache.org
Subject svn commit: r1146173 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
Date Wed, 13 Jul 2011 18:03:31 GMT
Author: spark
Date: Wed Jul 13 18:03:31 2011
New Revision: 1146173

URL: http://svn.apache.org/viewvc?rev=1146173&view=rev
Log:
bug fix in ec2:firewall_rule_id

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb?rev=1146173&r1=1146172&r2=1146173&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb Wed Jul 13
18:03:31 2011
@@ -810,14 +810,15 @@ module Deltacloud
         def firewall_rule_id(user_id, protocol, from_port, to_port, sources)
           sources_string = ""
           sources.each do |source|
-            sources_string<<"@"
-            source.each_pair do |key,value|
-              sources_string<< "#{value},"
-            end
-            sources_string.chomp!(",")
+          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}"
+         id_string = "#{user_id}~#{protocol}~#{from_port}~#{to_port}~#{sources_string.chomp!(",")}"
+#sources_string.slice(0,sources_string.length-1)}"
         end
 
         #extract params from uid



Mime
View raw message