From 95f39d52faa3c90f161548a9152cee14d0171416 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 6 Oct 2014 16:32:00 +0200 Subject: [PATCH] Added better check if nfs server is available on SUSE hosts --- plugins/hosts/suse/cap/nfs.rb | 4 ++++ plugins/hosts/suse/plugin.rb | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/plugins/hosts/suse/cap/nfs.rb b/plugins/hosts/suse/cap/nfs.rb index facaa68ae..42bde6bb2 100644 --- a/plugins/hosts/suse/cap/nfs.rb +++ b/plugins/hosts/suse/cap/nfs.rb @@ -2,6 +2,10 @@ module VagrantPlugins module HostSUSE module Cap class NFS + def self.nfs_installed(env) + system("rpm -q nfs-kernel-server > /dev/null 2>&1") + end + def self.nfs_check_command(env) "pidof nfsd > /dev/null" end diff --git a/plugins/hosts/suse/plugin.rb b/plugins/hosts/suse/plugin.rb index a2d692536..3aa1b441f 100644 --- a/plugins/hosts/suse/plugin.rb +++ b/plugins/hosts/suse/plugin.rb @@ -11,6 +11,11 @@ module VagrantPlugins Host end + host_capability("suse", "nfs_installed") do + require_relative "cap/nfs" + Cap::NFS + end + host_capability("suse", "nfs_check_command") do require_relative "cap/nfs" Cap::NFS