Merge pull request #6 from nagas/fix/unnecessary-double-check

remove unnecessary checks
This commit is contained in:
Shawn Dahlen 2013-04-21 19:01:53 -07:00
commit ac09f7273e
1 changed files with 6 additions and 12 deletions

View File

@ -19,24 +19,18 @@ module VagrantPlugins
def validate(machine) def validate(machine)
errors = Array.new errors = Array.new
# check if auto_update option is defined in Vagrantfile # check if auto_update option is either true or false
# and check if is either true or false accordingly if ![TrueClass, FalseClass].include?(auto_update.class)
if (machine.config.hostmanager.auto_update &&
![TrueClass, FalseClass].include?(auto_update.class))
errors << "A value for hostmanager.auto_update can be true or false." errors << "A value for hostmanager.auto_update can be true or false."
end end
# check if ignore_private_ip option is defined in Vagrantfile # check if ignore_private_ip option is either true or false
# and check if is either true or false accordingly if ![TrueClass, FalseClass].include?(ignore_private_ip.class)
if (machine.config.hostmanager.ignore_private_ip &&
![TrueClass, FalseClass].include?(ignore_private_ip.class))
errors << "A value for hostmanager.ignore_private_ip can be true or false." errors << "A value for hostmanager.ignore_private_ip can be true or false."
end end
# check if aliases option is defined in Vagrantfile # check if aliases option is an Array
# and check if is an Array accordingly if !machine.config.hostmanager.aliases.kind_of?(Array)
if (machine.config.hostmanager.aliases &&
!machine.config.hostmanager.aliases.kind_of?(Array))
errors << "A value for hostmanager.aliases must be an Array." errors << "A value for hostmanager.aliases must be an Array."
end end