Skip to content

Commit

Permalink
remove usage of blank? and just check for nil
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Aug 18, 2010
1 parent 8da5f62 commit 71ff61e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/fog/aws/models/ec2/server.rb
Expand Up @@ -33,7 +33,7 @@ class Server < Fog::Model
attribute :user_data

def initialize(attributes={})
@groups ||= ["default"] if attributes[:subnet_id].blank?
@groups ||= ["default"] unless attributes[:subnet_id]
@flavor_id ||= 'm1.small'
super
end
Expand Down Expand Up @@ -132,10 +132,10 @@ def save
# If subnet is defined we are working on a virtual private cloud.
# subnet & security group cannot co-exist. I wish VPC just ignored
# the security group parameter instead, it would be much easier!
if subnet_id.blank?
options.delete('SubnetId')
else
if subnet_id
options.delete('SecurityGroup')
else
options.delete('SubnetId')
end

data = connection.run_instances(@image_id, 1, 1, options)
Expand Down

0 comments on commit 71ff61e

Please sign in to comment.