From 6e7490f16e2fec57fe55d153f0516456652b467e Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 10 Apr 2013 18:56:33 -0300 Subject: [PATCH] Remove duplicated code --- lib/vagrant-lxc/driver.rb | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/vagrant-lxc/driver.rb b/lib/vagrant-lxc/driver.rb index fb52db8..3c43e64 100644 --- a/lib/vagrant-lxc/driver.rb +++ b/lib/vagrant-lxc/driver.rb @@ -105,22 +105,6 @@ module Vagrant end def assigned_ip - ip = '' - retryable(:on => LXC::Errors::ExecuteError, :tries => 10, :sleep => 3) do - unless ip = get_container_ip_from_ip_addr - # retry - raise LXC::Errors::ExecuteError, :command => "lxc-attach" - end - end - ip - end - - # From: https://github.com/lxc/lxc/blob/staging/src/python-lxc/lxc/__init__.py#L371-L385 - def get_container_ip_from_ip_addr - output = @cli.attach '/sbin/ip', '-4', 'addr', 'show', 'scope', 'global', 'eth0', namespaces: 'network' - if output =~ /^\s+inet ([0-9.]+)\/[0-9]+\s+/ - return $1.to_s - end end protected