From 752fa9b4e574742b42e3f1c01de1b40d4c7e2d51 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 24 Jul 2014 20:08:42 -0300 Subject: [PATCH] action/fetch_ip_with_lxc_attach: Attach to the MOUNT namespace in order to fix GH-300 --- CHANGELOG.md | 3 +++ lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a07b0..154c099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,10 +8,13 @@ IMPROVEMENTS: BUG FIXES: + - Attach to containers using the `MOUNT` namespace when attempting to fetch + container's IP [[GH-300]] - Escape space characters for synced folders [[GH-291]] - Use Vagrant's ruby on the sudoers file so that it works on systems that don't have a global ruby installation [[GH-289]] +[GH-300]: https://github.com/fgrehm/vagrant-lxc/issues/300 [GH-291]: https://github.com/fgrehm/vagrant-lxc/issues/291 [GH-289]: https://github.com/fgrehm/vagrant-lxc/issues/289 diff --git a/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb b/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb index 3569c69..5b36c18 100644 --- a/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb +++ b/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb @@ -32,7 +32,7 @@ module Vagrant # From: https://github.com/lxc/lxc/blob/staging/src/python-lxc/lxc/__init__.py#L371-L385 def get_container_ip_from_ip_addr(driver) - output = driver.attach '/sbin/ip', '-4', 'addr', 'show', 'scope', 'global', 'eth0', namespaces: 'network' + output = driver.attach '/sbin/ip', '-4', 'addr', 'show', 'scope', 'global', 'eth0', namespaces: ['network', 'mount'] if output =~ /^\s+inet ([0-9.]+)\/[0-9]+\s+/ return $1.to_s end