summaryrefslogtreecommitdiff
path: root/lib/chef/util/selinux.rb
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-11-08 22:45:28 -0800
committerSerdar Sutay <serdar@opscode.com>2014-11-08 22:45:28 -0800
commitf8df84e6748e7dd71343fd7844255aa37dbfab78 (patch)
treea0a7cb236eaba619502083ead157cd885ebf8d77 /lib/chef/util/selinux.rb
parent5ac565eaac581602115c18f0ed9b38b83bedcc31 (diff)
parentbdadb31d463a3143f9f25e358d25f37749c6d072 (diff)
downloadchef-jdm/foo.tar.gz
Merge pull request #2336 from opscode/lcg/12-systemd-fixesjdm/foo
fix systemd for Ubuntu 14.10
Diffstat (limited to 'lib/chef/util/selinux.rb')
-rw-r--r--lib/chef/util/selinux.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/chef/util/selinux.rb b/lib/chef/util/selinux.rb
index 92d5756552..778da042e3 100644
--- a/lib/chef/util/selinux.rb
+++ b/lib/chef/util/selinux.rb
@@ -21,6 +21,7 @@
# limitations under the License.
require 'chef/mixin/shell_out'
+require 'chef/mixin/which'
class Chef
class Util
@@ -32,6 +33,7 @@ class Chef
module Selinux
include Chef::Mixin::ShellOut
+ include Chef::Mixin::Which
# We want to initialize below variables once during a
# chef-client run therefore they are class variables.
@@ -67,15 +69,6 @@ class Chef
@@selinuxenabled_path
end
- def which(cmd)
- paths = ENV['PATH'].split(File::PATH_SEPARATOR) + [ '/bin', '/usr/bin', '/sbin', '/usr/sbin' ]
- paths.each do |path|
- filename = File.join(path, cmd)
- return filename if File.executable?(filename)
- end
- false
- end
-
def check_selinux_enabled?
if selinuxenabled_path
cmd = shell_out!(selinuxenabled_path, :returns => [0,1])
@@ -97,4 +90,3 @@ class Chef
end
end
end
-