Merge pull request #5927 from mitchellh/sethvargo/sudo_read_ip_address

Use sudo for read_ip_address capability
This commit is contained in:
Mitchell Hashimoto 2015-07-10 14:33:30 -06:00
commit fe581a2085
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ module VagrantPlugins
def self.read_ip_address(machine)
command = "LANG=en ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'"
result = ""
machine.communicate.execute(command) do |type, data|
machine.communicate.sudo(command) do |type, data|
result << data if type == :stdout
end