action/fetch_ip_with_lxc_attach: Attach to the MOUNT namespace in order to fix GH-300

This commit is contained in:
Fabio Rehm 2014-07-24 20:08:42 -03:00
parent 95b18a5d5c
commit 752fa9b4e5
2 changed files with 4 additions and 1 deletions

View file

@ -8,10 +8,13 @@ IMPROVEMENTS:
BUG FIXES: 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]] - 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 - Use Vagrant's ruby on the sudoers file so that it works on systems that don't
have a global ruby installation [[GH-289]] 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-291]: https://github.com/fgrehm/vagrant-lxc/issues/291
[GH-289]: https://github.com/fgrehm/vagrant-lxc/issues/289 [GH-289]: https://github.com/fgrehm/vagrant-lxc/issues/289

View file

@ -32,7 +32,7 @@ module Vagrant
# From: https://github.com/lxc/lxc/blob/staging/src/python-lxc/lxc/__init__.py#L371-L385 # From: https://github.com/lxc/lxc/blob/staging/src/python-lxc/lxc/__init__.py#L371-L385
def get_container_ip_from_ip_addr(driver) 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+/ if output =~ /^\s+inet ([0-9.]+)\/[0-9]+\s+/
return $1.to_s return $1.to_s
end end