A more reliable way to detect Ubuntu
lsb_release command is included in lsb-release package. Sometimes this is not installed; ex: Docker official Ubuntu image. /etc/os-release is included in base-files package, so this is more reliable than lsb_release.
This commit is contained in:
parent
a4f45a18a6
commit
05782f1d0e
|
@ -2,7 +2,7 @@ module VagrantPlugins
|
|||
module GuestUbuntu
|
||||
class Guest < Vagrant.plugin("2", :guest)
|
||||
def detect?(machine)
|
||||
machine.communicate.test("[ -x /usr/bin/lsb_release ] && /usr/bin/lsb_release -i 2>/dev/null | grep Ubuntu")
|
||||
machine.communicate.test("test -r /etc/os-release && . /etc/os-release && test xubuntu = x$ID")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue