Permalink
Browse files

[ec2] fix a race condition around address model instantiation

  • Loading branch information...
1 parent 058a358 commit 976e4bdcf1c77d348361de53bde511c75580a092 @geemus geemus committed May 10, 2010
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/fog/aws/models/ec2/address.rb
@@ -10,6 +10,12 @@ class Address < Fog::Model
attribute :server_id, 'instanceId'
+ def initialize(attributes = {})
+ # assign server first to prevent race condition with new_record?
+ self.server = attributes.delete(:server)
+ super
+ end
+
def destroy
requires :public_ip

0 comments on commit 976e4bd

Please sign in to comment.