read_ip_address linux cap only reads ip of first device [GH-1799]
This commit is contained in:
parent
80f06605fb
commit
5e48391b05
|
@ -31,6 +31,8 @@ BUG FIXES:
|
||||||
errors. [GH-1691]
|
errors. [GH-1691]
|
||||||
- Setting hostname on SLES 11 works again. [GH-1781]
|
- Setting hostname on SLES 11 works again. [GH-1781]
|
||||||
- `config.vm.guest` properly forces guests again. [GH-1800]
|
- `config.vm.guest` properly forces guests again. [GH-1800]
|
||||||
|
- The `read_ip_address` capability for linux properly reads the IP
|
||||||
|
of only the first network interface. [GH-1799]
|
||||||
|
|
||||||
## 1.2.2 (April 23, 2013)
|
## 1.2.2 (April 23, 2013)
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,13 @@ module VagrantPlugins
|
||||||
module Cap
|
module Cap
|
||||||
class ReadIPAddress
|
class ReadIPAddress
|
||||||
def self.read_ip_address(machine)
|
def self.read_ip_address(machine)
|
||||||
command = "ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'"
|
command = "ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'"
|
||||||
result = ""
|
result = ""
|
||||||
machine.communicate.execute(command) do |type, data|
|
machine.communicate.execute(command) do |type, data|
|
||||||
result << data if type == :stdout
|
result << data if type == :stdout
|
||||||
end
|
end
|
||||||
|
|
||||||
result.chomp
|
result.chomp.split("\n").first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue