From dea85d7cbca71bbb0ce4f3e79bccf0f7b5efe898 Mon Sep 17 00:00:00 2001 From: Nicholas Brown Date: Fri, 2 Feb 2018 13:03:23 +0000 Subject: [PATCH] Don't silently ignore udp port forwarding option Currently it ignores the option and turns it into a tcp port. Instead warn about the UDP option and skip it. --- lib/vagrant-libvirt/action/forward_ports.rb | 5 +++++ locales/en.yml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib/vagrant-libvirt/action/forward_ports.rb b/lib/vagrant-libvirt/action/forward_ports.rb index 3e8b8c6..dfdfc6a 100644 --- a/lib/vagrant-libvirt/action/forward_ports.rb +++ b/lib/vagrant-libvirt/action/forward_ports.rb @@ -47,6 +47,11 @@ module VagrantPlugins message_attributes )) + if fp[:protocol] == 'udp' + env[:ui].warn I18n.t('vagrant_libvirt.warnings.forwarding_udp') + next + end + ssh_pid = redirect_port( @env[:machine], fp[:host_ip] || 'localhost', diff --git a/locales/en.yml b/locales/en.yml index 316f0c5..cd88b56 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -54,6 +54,8 @@ en: ignoring_virtual_size_too_small: |- Ignoring requested virtual disk size of '%{requested}' as it is below the minimum box image size of '%{minimum}'. + forwarding_udp: |- + Forwarding UDP ports is not supported. Ignoring. errors: package_not_supported: No support for package with libvirt. Create box manually.