Skip to content

Commit

Permalink
Merge pull request #6 from nagas/fix/unnecessary-double-check
Browse files Browse the repository at this point in the history
remove unnecessary checks
  • Loading branch information
smdahlen committed Apr 22, 2013
2 parents d1201e5 + 78f8acf commit ac09f72
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions lib/vagrant-hostmanager/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,18 @@ def finalize!
def validate(machine)
errors = Array.new

# check if auto_update option is defined in Vagrantfile
# and check if is either true or false accordingly
if (machine.config.hostmanager.auto_update &&
![TrueClass, FalseClass].include?(auto_update.class))
# check if auto_update option is either true or false
if ![TrueClass, FalseClass].include?(auto_update.class)
errors << "A value for hostmanager.auto_update can be true or false."
end

# check if ignore_private_ip option is defined in Vagrantfile
# and check if is either true or false accordingly
if (machine.config.hostmanager.ignore_private_ip &&
![TrueClass, FalseClass].include?(ignore_private_ip.class))
# check if ignore_private_ip option is either true or false
if ![TrueClass, FalseClass].include?(ignore_private_ip.class)
errors << "A value for hostmanager.ignore_private_ip can be true or false."
end

# check if aliases option is defined in Vagrantfile
# and check if is an Array accordingly
if (machine.config.hostmanager.aliases &&
!machine.config.hostmanager.aliases.kind_of?(Array))
# check if aliases option is an Array
if !machine.config.hostmanager.aliases.kind_of?(Array)
errors << "A value for hostmanager.aliases must be an Array."
end

Expand Down

0 comments on commit ac09f72

Please sign in to comment.