remove unnecessary checks
This commit is contained in:
		
							parent
							
								
									5f384570ca
								
							
						
					
					
						commit
						78f8acf267
					
				| 
						 | 
					@ -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
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue