Merge pull request #10512 from chrisroberts/f-hostnamectl-no-dbus

Validate hostnamectl command is in working state
This commit is contained in:
Chris Roberts 2018-12-17 16:14:23 -08:00 committed by GitHub
commit 66938d20cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -36,8 +36,12 @@ module Vagrant
#
# @param [Vagrant::Plugin::V2::Communicator] comm Guest communicator
# @return [Boolean]
# NOTE: This test includes actually calling `hostnamectl` to verify
# that it is in working order. This prevents attempts to use the
# hostnamectl command when it is available, but dbus is not which
# renders the command useless
def hostnamectl?(comm)
comm.test("command -v hostnamectl")
comm.test("command -v hostnamectl && hostnamectl")
end
## netplan helpers