diff --git a/CHANGELOG.md b/CHANGELOG.md index e0fcc99b5..032db62e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ BUG FIXES: status 126). [GH-934] - Action hook prepend/append will only prepend or append once. - Retry SSH on Errno::EACCES. + - Show an error if an invalid network type is used. ## 1.1.4 (March 25, 2013) diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 58ba2006a..2273331a2 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -297,8 +297,14 @@ module VagrantPlugins # Validate networks has_fp_port_error = false fp_host_ports = Set.new + valid_network_types = [:forwarded_port, :private_network, :public_network] networks.each do |type, options| + if !valid_network_types.include?(type) + errors << I18n.t("vagrant.config.vm.network_type_invalid", + :type => type.to_s) + end + if type == :forwarded_port if !has_fp_port_error && (!options[:guest] || !options[:host]) errors << I18n.t("vagrant.config.vm.network_fp_requires_ports") diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 5428e5a8d..4c384c0d3 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -494,6 +494,8 @@ en: Forwarded port '%{host}' (host port) is declared multiple times network_fp_requires_ports: |- Forwarded port definitions require a "host" and "guest" value + network_type_invalid: |- + Network type '%{type}' is invalid. Please use a valid network type. provisioner_not_found: |- The '%{name}' provisioner could not be found. shared_folder_guestpath_duplicate: |-