Remove duplicated code
This commit is contained in:
parent
e10d6863e9
commit
6e7490f16e
1 changed files with 0 additions and 16 deletions
|
@ -105,22 +105,6 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def assigned_ip
|
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
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
Loading…
Reference in a new issue