diff options
author | Nikola Kotur <kotnick@gmail.com> | 2014-08-13 11:25:55 +0200 |
---|---|---|
committer | Nikola Kotur <kotnick@gmail.com> | 2014-08-13 11:26:13 +0200 |
commit | 376006cbe112d9d717e107ffd48ceb3957b6a90c (patch) | |
tree | 085f426e982dfb9725a99995ddd31e1a6a212f04 /lib | |
parent | 454a4434de4dba19b8733c2f47a569b11f79bac8 (diff) | |
download | puppet-gluster-376006cbe112d9d717e107ffd48ceb3957b6a90c.tar.gz puppet-gluster-376006cbe112d9d717e107ffd48ceb3957b6a90c.tar.xz puppet-gluster-376006cbe112d9d717e107ffd48ceb3957b6a90c.zip |
Discover cut command location.
This fix issues with Debian Squeeze and later that include newer coreutils
package which puts `cut` in `/usr/bin`.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/gluster_version.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/facter/gluster_version.rb b/lib/facter/gluster_version.rb index ee14de5..a3df7bc 100644 --- a/lib/facter/gluster_version.rb +++ b/lib/facter/gluster_version.rb @@ -25,13 +25,14 @@ if gluster == '' gluster = '/usr/sbin/gluster' end end +cut = `which cut 2> /dev/null`.chomp # create the fact if the gluster executable exists if File.exist?(gluster) Facter.add('gluster_version') do #confine :operatingsystem => %w{CentOS, RedHat, Fedora} setcode { - Facter::Util::Resolution.exec(gluster+' --version | /usr/bin/head -1 | /bin/cut -d " " -f 2').chomp + Facter::Util::Resolution.exec(gluster+' --version | /usr/bin/head -1 | '+cut+' -d " " -f 2').chomp } end end |