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