module Puppet::Util::Platform

Constants

FIPS_STATUS_FILE
WINDOWS_FIPS_REGISTRY_KEY

Public Class Methods

default_paths() click to toggle source
   # File lib/puppet/util/platform.rb
23 def default_paths
24   return [] if windows?
25 
26   %w{/usr/sbin /sbin}
27 end
fips_enabled?() click to toggle source
   # File lib/puppet/util/platform.rb
45 def fips_enabled?
46   @fips_enabled
47 end
jruby?() click to toggle source
   # File lib/puppet/util/platform.rb
50 def self.jruby?
51   RUBY_PLATFORM == 'java'
52 end
jruby_fips?() click to toggle source
   # File lib/puppet/util/platform.rb
54 def jruby_fips?
55   @@jruby_fips ||= if RUBY_PLATFORM == 'java'
56                      require 'java'
57 
58                      begin
59                        require 'openssl'
60                        false
61                      rescue LoadError, NameError
62                        true
63                      end
64                    else
65                      false
66                    end
67 end
solaris?() click to toggle source
   # File lib/puppet/util/platform.rb
18 def solaris?
19   RUBY_PLATFORM.include?('solaris')
20 end
windows?() click to toggle source
   # File lib/puppet/util/platform.rb
 8 def windows?
 9   # Ruby only sets File::ALT_SEPARATOR on Windows and the Ruby standard
10   # library uses that to test what platform it's on. In some places we
11   # would use Puppet.features.microsoft_windows?, but this method can be
12   # used to determine the behavior of the underlying system without
13   # requiring features to be initialized and without side effect.
14   !!File::ALT_SEPARATOR
15 end

Private Instance Methods

default_paths() click to toggle source
   # File lib/puppet/util/platform.rb
23 def default_paths
24   return [] if windows?
25 
26   %w{/usr/sbin /sbin}
27 end
fips_enabled?() click to toggle source
   # File lib/puppet/util/platform.rb
45 def fips_enabled?
46   @fips_enabled
47 end
jruby_fips?() click to toggle source
   # File lib/puppet/util/platform.rb
54 def jruby_fips?
55   @@jruby_fips ||= if RUBY_PLATFORM == 'java'
56                      require 'java'
57 
58                      begin
59                        require 'openssl'
60                        false
61                      rescue LoadError, NameError
62                        true
63                      end
64                    else
65                      false
66                    end
67 end
solaris?() click to toggle source
   # File lib/puppet/util/platform.rb
18 def solaris?
19   RUBY_PLATFORM.include?('solaris')
20 end
windows?() click to toggle source
   # File lib/puppet/util/platform.rb
 8 def windows?
 9   # Ruby only sets File::ALT_SEPARATOR on Windows and the Ruby standard
10   # library uses that to test what platform it's on. In some places we
11   # would use Puppet.features.microsoft_windows?, but this method can be
12   # used to determine the behavior of the underlying system without
13   # requiring features to be initialized and without side effect.
14   !!File::ALT_SEPARATOR
15 end