diff --git a/CHANGELOG.md b/CHANGELOG.md index c09b9276d..4d050f890 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ BUG FIXES: to be ready - core: `Guest#capability?` now works with strings as well - core: Fix NoMethodError in the new `Vagrant.has_plugin?` method [GH-2189] + - core: Convert forwarded port parameters to integers. [GH-2173] - hosts/arch: NFS exporting works properly, no exceptions. [GH-2161] - hosts/bsd: Use only `sudo` for writing NFS exports. This lets NFS exports work if you have sudo privs but not `su`. [GH-2191] diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index 1d598a9bd..cc789d21a 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -263,6 +263,14 @@ module VagrantPlugins # default VM which just inherits the rest of the configuration. define(DEFAULT_VM_NAME) if defined_vm_keys.empty? + # Clean up some network configurations + @__networks.each do |type, opts| + if type == :forwarded_port + opts[:guest] = opts[:guest].to_i if opts[:guest] + opts[:host] = opts[:host].to_i if opts[:host] + end + end + # Compile all the provider configurations @__providers.each do |name, blocks| # If we don't have any configuration blocks, then ignore it