Merge pull request #11212 from briancain/NFS-RHEL-FIXUP

Ensure `nfs-server` is restarted when installing nfs client for redhat guests
This commit is contained in:
Brian Cain 2019-11-22 10:15:50 -08:00 committed by GitHub
commit f5886e6044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ module VagrantPlugins
def self.nfs_client_install(machine)
machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '')
if command -v dnf; then
if `dnf info -q libnfs-utils > /dev/null 2>&1` ; then
if `dnf info -q libnfs-utils > /dev/null 2>&1` ; then
dnf -y install nfs-utils libnfs-utils portmap
else
dnf -y install nfs-utils nfs-utils-lib portmap
@ -15,7 +15,7 @@ module VagrantPlugins
fi
if test $(ps -o comm= 1) == 'systemd'; then
/bin/systemctl restart rpcbind nfs
/bin/systemctl restart rpcbind nfs-server
else
/etc/init.d/rpcbind restart
/etc/init.d/nfs restart

View File

@ -24,7 +24,7 @@ describe "VagrantPlugins::GuestRedHat::Cap:NFSClient" do
it "installs nfs client" do
cap.nfs_client_install(machine)
expect(comm.received_commands[0]).to match(/install nfs-utils/)
expect(comm.received_commands[0]).to match(/\/bin\/systemctl restart rpcbind nfs/)
expect(comm.received_commands[0]).to match(/\/bin\/systemctl restart rpcbind nfs-server/)
end
end
end