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:
parent
8da5f624d5
commit
71ff61e878
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue