1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

remove usage of blank? and just check for nil

This commit is contained in:
geemus 2010-08-18 08:47:51 -07:00
parent 8da5f624d5
commit 71ff61e878

View file

@ -33,7 +33,7 @@ module Fog
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
@ -132,10 +132,10 @@ module Fog
# 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)