facter 2.2.0-x64-mingw32 → 2.3.0-x64-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of facter might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CONTRIBUTING.md +4 -0
- data/Gemfile +2 -1
- data/LICENSE +1 -1
- data/ext/project_data.yaml +2 -2
- data/lib/facter/ec2.rb +2 -2
- data/lib/facter/gid.rb +10 -1
- data/lib/facter/interfaces.rb +2 -0
- data/lib/facter/ipaddress6.rb +1 -1
- data/lib/facter/ldom.rb +4 -1
- data/lib/facter/macosx.rb +2 -2
- data/lib/facter/operatingsystem/linux.rb +13 -1
- data/lib/facter/operatingsystem/sunos.rb +1 -1
- data/lib/facter/operatingsystem/windows.rb +7 -0
- data/lib/facter/physicalprocessorcount.rb +1 -1
- data/lib/facter/processor.rb +3 -3
- data/lib/facter/processors/os.rb +11 -1
- data/lib/facter/rackspace.rb +8 -5
- data/lib/facter/rubyplatform.rb +12 -0
- data/lib/facter/selinux.rb +9 -9
- data/lib/facter/system32.rb +21 -0
- data/lib/facter/util/macosx.rb +1 -1
- data/lib/facter/util/parser.rb +12 -2
- data/lib/facter/util/uptime.rb +1 -1
- data/lib/facter/util/virtual.rb +13 -2
- data/lib/facter/version.rb +1 -1
- data/lib/facter/virtual.rb +5 -3
- data/spec/fixtures/ifconfig/linux_ifconfig_all_with_multiple_interfaces_and_fe80 +19 -0
- data/spec/fixtures/ifconfig/linux_ifconfig_all_with_multiple_interfaces_and_no_public_ipv6 +18 -0
- data/spec/schema/validate_facter_schema.rb +18 -0
- data/spec/unit/ec2_spec.rb +18 -6
- data/spec/unit/gid_spec.rb +22 -2
- data/spec/unit/interfaces_spec.rb +2 -2
- data/spec/unit/ipaddress6_spec.rb +24 -6
- data/spec/unit/ldom_spec.rb +13 -0
- data/spec/unit/operatingsystem/linux_spec.rb +22 -10
- data/spec/unit/operatingsystem/sunos_spec.rb +3 -3
- data/spec/unit/operatingsystem/windows_spec.rb +21 -0
- data/spec/unit/physicalprocessorcount_spec.rb +1 -1
- data/spec/unit/processor_spec.rb +1 -1
- data/spec/unit/processors/os_spec.rb +15 -1
- data/spec/unit/rackspace_spec.rb +3 -3
- data/spec/unit/rubyplatform_spec.rb +7 -0
- data/spec/unit/selinux_spec.rb +5 -5
- data/spec/unit/system32_spec.rb +28 -0
- data/spec/unit/util/macosx_spec.rb +1 -1
- data/spec/unit/util/parser_spec.rb +36 -3
- data/spec/unit/util/uptime_spec.rb +2 -2
- data/spec/unit/virtual_spec.rb +52 -26
- metadata +647 -643
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 9f3d90195b5ca6fd3f54b2fcfdd6ce2f4178f9ca
         | 
| 4 | 
            +
              data.tar.gz: f8cd9e330c18fdb40004a468feeaf2a01b4f25d8
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: 2a26c44305a901f7a697fa92153f237a0ede81d95f4e2806f2c411fe1d960a6fe87f6060924ae7f52cf4836431a6c567e035c43d338a32d906b02844bd0adab2
         | 
| 7 | 
            +
              data.tar.gz: ed7a953122c9fcfffd2c3a45eead4d15ebfd78cbd2c3d6aa1a1a0d269c8c5097416a957d07367b911d6183d6c8d127bb408d884d747c7446057e8dbdc95f46c3
         | 
    
        data/CONTRIBUTING.md
    CHANGED
    
    | @@ -16,6 +16,10 @@ top of things. | |
| 16 16 | 
             
              * Make sure you fill in the earliest version that you know has the issue.
         | 
| 17 17 | 
             
            * Fork the repository on GitHub
         | 
| 18 18 |  | 
| 19 | 
            +
            ## New Facts
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            All new facts should also be included in `schema/facter.json`. Without this facts won't pass acceptance tests.
         | 
| 22 | 
            +
             | 
| 19 23 | 
             
            ## Making Changes
         | 
| 20 24 |  | 
| 21 25 | 
             
            * Create a topic branch from where you want to base your work.
         | 
    
        data/Gemfile
    CHANGED
    
    | @@ -13,6 +13,7 @@ group :development, :test do | |
| 13 13 | 
             
              gem 'rspec', "~> 2.11.0"
         | 
| 14 14 | 
             
              gem 'mocha', "~> 0.10.5"
         | 
| 15 15 | 
             
              gem 'json', "~> 1.7", :platforms => :ruby
         | 
| 16 | 
            +
              gem 'json-schema', :platforms => :ruby
         | 
| 16 17 | 
             
              gem 'puppetlabs_spec_helper'
         | 
| 17 18 | 
             
            end
         | 
| 18 19 |  | 
| @@ -39,7 +40,7 @@ mingw = [:mingw] | |
| 39 40 | 
             
            mingw << :x64_mingw if Bundler::Dsl::VALID_PLATFORMS.include?(:x64_mingw)
         | 
| 40 41 |  | 
| 41 42 | 
             
            platform(*mingw) do
         | 
| 42 | 
            -
              gem 'ffi', '~> 1.9. | 
| 43 | 
            +
              gem 'ffi', '~> 1.9.5', :require => false
         | 
| 43 44 | 
             
              gem 'win32-dir', '~> 0.4.8', :require => false
         | 
| 44 45 | 
             
              gem 'win32-security', '~> 0.2.5', :require => false
         | 
| 45 46 | 
             
            end
         | 
    
        data/LICENSE
    CHANGED
    
    
    
        data/ext/project_data.yaml
    CHANGED
    
    | @@ -19,13 +19,13 @@ gem_platform_dependencies: | |
| 19 19 | 
             
                  CFPropertyList: '~> 2.2.6'
         | 
| 20 20 | 
             
              x86-mingw32:
         | 
| 21 21 | 
             
                gem_runtime_dependencies:
         | 
| 22 | 
            -
                  ffi: '~> 1.9. | 
| 22 | 
            +
                  ffi: '~> 1.9.5'
         | 
| 23 23 | 
             
                  win32-dir: '~> 0.4.8'
         | 
| 24 24 | 
             
                  win32-security: '~> 0.2.5'
         | 
| 25 25 | 
             
                  win32console: '~> 1.3.2'
         | 
| 26 26 | 
             
              x64-mingw32:
         | 
| 27 27 | 
             
                gem_runtime_dependencies:
         | 
| 28 | 
            -
                  ffi: '~> 1.9. | 
| 28 | 
            +
                  ffi: '~> 1.9.5'
         | 
| 29 29 | 
             
                  win32-dir: '~> 0.4.8'
         | 
| 30 30 | 
             
                  win32-security: '~> 0.2.5'
         | 
| 31 31 | 
             
            bundle_platforms:
         | 
    
        data/lib/facter/ec2.rb
    CHANGED
    
    | @@ -20,7 +20,7 @@ require 'facter/ec2/rest' | |
| 20 20 | 
             
            Facter.define_fact(:ec2_metadata) do
         | 
| 21 21 | 
             
              define_resolution(:rest) do
         | 
| 22 22 | 
             
                confine do
         | 
| 23 | 
            -
                  Facter.value(:virtual).match /^xen/
         | 
| 23 | 
            +
                  Facter.value(:virtual).match /^(xen|kvm)/
         | 
| 24 24 | 
             
                end
         | 
| 25 25 |  | 
| 26 26 | 
             
                @querier = Facter::EC2::Metadata.new
         | 
| @@ -37,7 +37,7 @@ end | |
| 37 37 | 
             
            Facter.define_fact(:ec2_userdata) do
         | 
| 38 38 | 
             
              define_resolution(:rest) do
         | 
| 39 39 | 
             
                confine do
         | 
| 40 | 
            -
                  Facter.value(:virtual).match /^xen/
         | 
| 40 | 
            +
                  Facter.value(:virtual).match /^(xen|kvm)/
         | 
| 41 41 | 
             
                end
         | 
| 42 42 |  | 
| 43 43 | 
             
                @querier = Facter::EC2::Userdata.new
         | 
    
        data/lib/facter/gid.rb
    CHANGED
    
    | @@ -10,7 +10,16 @@ | |
| 10 10 |  | 
| 11 11 | 
             
            Facter.add(:gid) do
         | 
| 12 12 | 
             
              confine do
         | 
| 13 | 
            -
                Facter::Core::Execution.which('id')
         | 
| 13 | 
            +
                Facter::Core::Execution.which('id') && Facter.value(:kernel) != "SunOS"
         | 
| 14 14 | 
             
              end
         | 
| 15 15 | 
             
              setcode { Facter::Core::Execution.exec('id -ng') }
         | 
| 16 16 | 
             
            end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            Facter.add(:gid) do
         | 
| 19 | 
            +
              confine :kernel => :SunOS
         | 
| 20 | 
            +
              setcode do
         | 
| 21 | 
            +
                if File.exist? '/usr/xpg4/bin/id'
         | 
| 22 | 
            +
                  Facter::Core::Execution.exec('/usr/xpg4/bin/id -ng')
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
              end
         | 
| 25 | 
            +
            end
         | 
    
        data/lib/facter/interfaces.rb
    CHANGED
    
    | @@ -41,6 +41,8 @@ Facter::Util::IP.get_interfaces.each do |interface| | |
| 41 41 | 
             
                    value = Facter::Util::IP.get_interface_value(interface, label)
         | 
| 42 42 | 
             
                    if label == "macaddress"
         | 
| 43 43 | 
             
                      value = Facter::Util::Macaddress.standardize(value)
         | 
| 44 | 
            +
                    elsif label == "mtu"
         | 
| 45 | 
            +
                      value = value.to_i
         | 
| 44 46 | 
             
                    end
         | 
| 45 47 | 
             
                    value
         | 
| 46 48 | 
             
                  end
         | 
    
        data/lib/facter/ipaddress6.rb
    CHANGED
    
    | @@ -28,7 +28,7 @@ def get_address_after_token(output, token, return_first=false) | |
| 28 28 |  | 
| 29 29 | 
             
              String(output).scan(/#{token}\s?((?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/).each do |match|
         | 
| 30 30 | 
             
                match = match.first
         | 
| 31 | 
            -
                unless match =~  | 
| 31 | 
            +
                unless match =~ /^fe80.*/ or match == "::1"
         | 
| 32 32 | 
             
                  ip = match
         | 
| 33 33 | 
             
                  break if return_first
         | 
| 34 34 | 
             
                end
         | 
    
        data/lib/facter/ldom.rb
    CHANGED
    
    | @@ -9,7 +9,10 @@ | |
| 9 9 | 
             
            #   Uses the output of `virtinfo -ap`.
         | 
| 10 10 | 
             
            #
         | 
| 11 11 |  | 
| 12 | 
            -
            if Facter.value(:kernel) == 'SunOS'  | 
| 12 | 
            +
            if Facter.value(:kernel) == 'SunOS' &&
         | 
| 13 | 
            +
               Facter.value(:hardwareisa) == 'sparc' &&
         | 
| 14 | 
            +
               Facter::Core::Execution.which('virtinfo')
         | 
| 15 | 
            +
             | 
| 13 16 | 
             
              virtinfo = Facter::Core::Execution.exec('virtinfo -ap')
         | 
| 14 17 |  | 
| 15 18 | 
             
              # Convert virtinfo parseable output format to array of arrays.
         | 
    
        data/lib/facter/macosx.rb
    CHANGED
    
    | @@ -31,7 +31,7 @@ if Facter.value(:kernel) == "Darwin" | |
| 31 31 | 
             
                Facter.add("sp_#{fact}") do
         | 
| 32 32 | 
             
                  confine :kernel => :darwin
         | 
| 33 33 | 
             
                  setcode do
         | 
| 34 | 
            -
                    value | 
| 34 | 
            +
                    value
         | 
| 35 35 | 
             
                  end
         | 
| 36 36 | 
             
                end
         | 
| 37 37 | 
             
              end
         | 
| @@ -40,7 +40,7 @@ if Facter.value(:kernel) == "Darwin" | |
| 40 40 | 
             
                Facter.add("sp_#{fact}") do
         | 
| 41 41 | 
             
                  confine :kernel => :darwin
         | 
| 42 42 | 
             
                  setcode do
         | 
| 43 | 
            -
                    value | 
| 43 | 
            +
                    value
         | 
| 44 44 | 
             
                  end
         | 
| 45 45 | 
             
                end
         | 
| 46 46 | 
             
              end
         | 
| @@ -31,7 +31,7 @@ module Facter | |
| 31 31 | 
             
                      "Suse"
         | 
| 32 32 | 
             
                    when "Gentoo"
         | 
| 33 33 | 
             
                      "Gentoo"
         | 
| 34 | 
            -
                    when "Archlinux"
         | 
| 34 | 
            +
                    when "Archlinux", "Manjarolinux"
         | 
| 35 35 | 
             
                      "Archlinux"
         | 
| 36 36 | 
             
                    when "Mageia", "Mandriva", "Mandrake"
         | 
| 37 37 | 
             
                      "Mandrake"
         | 
| @@ -46,6 +46,8 @@ module Facter | |
| 46 46 | 
             
                      get_alpine_release_with_release_file
         | 
| 47 47 | 
             
                    when "Amazon"
         | 
| 48 48 | 
             
                      get_amazon_release_with_lsb
         | 
| 49 | 
            +
                    when "AristaEOS"
         | 
| 50 | 
            +
                      get_arista_release_with_release_file
         | 
| 49 51 | 
             
                    when "BlueWhite64"
         | 
| 50 52 | 
             
                      get_bluewhite_release_with_release_file
         | 
| 51 53 | 
             
                    when "CentOS", "RedHat", "Scientific", "SLC", "Ascendos", "CloudLinux", "PSBM",
         | 
| @@ -239,6 +241,7 @@ module Facter | |
| 239 241 | 
             
                  def get_operatingsystem_with_release_files
         | 
| 240 242 | 
             
                    operatingsystem = nil
         | 
| 241 243 | 
             
                    release_files = {
         | 
| 244 | 
            +
                      "AristaEOS"   => "/etc/Eos-release",
         | 
| 242 245 | 
             
                      "Debian"      => "/etc/debian_version",
         | 
| 243 246 | 
             
                      "Gentoo"      => "/etc/gentoo-release",
         | 
| 244 247 | 
             
                      "Fedora"      => "/etc/fedora-release",
         | 
| @@ -247,6 +250,7 @@ module Facter | |
| 247 250 | 
             
                      "Mandrake"    => "/etc/mandrake-release",
         | 
| 248 251 | 
             
                      "MeeGo"       => "/etc/meego-release",
         | 
| 249 252 | 
             
                      "Archlinux"   => "/etc/arch-release",
         | 
| 253 | 
            +
                      "Manjarolinux"=> "/etc/manjaro-release",
         | 
| 250 254 | 
             
                      "OracleLinux" => "/etc/oracle-release",
         | 
| 251 255 | 
             
                      "OpenWrt"     => "/etc/openwrt_release",
         | 
| 252 256 | 
             
                      "Alpine"      => "/etc/alpine-release",
         | 
| @@ -345,6 +349,14 @@ module Facter | |
| 345 349 | 
             
                    end
         | 
| 346 350 | 
             
                  end
         | 
| 347 351 |  | 
| 352 | 
            +
                  def get_arista_release_with_release_file
         | 
| 353 | 
            +
                    if release = Facter::Util::FileRead.read('/etc/Eos-release')
         | 
| 354 | 
            +
                      if match = /\d+\.\d+(:?\.\d+)?[A-M]?$/.match(release)
         | 
| 355 | 
            +
                        match[0]
         | 
| 356 | 
            +
                      end
         | 
| 357 | 
            +
                    end
         | 
| 358 | 
            +
                  end
         | 
| 359 | 
            +
             | 
| 348 360 | 
             
                  def get_amazon_release_with_lsb
         | 
| 349 361 | 
             
                    if lsbdistrelease = get_lsbdistrelease
         | 
| 350 362 | 
             
                      lsbdistrelease
         | 
| @@ -9,6 +9,13 @@ module Facter | |
| 9 9 | 
             
                    Facter::Util::WMI.execquery("SELECT version, producttype FROM Win32_OperatingSystem").each do |os|
         | 
| 10 10 | 
             
                      result =
         | 
| 11 11 | 
             
                        case os.version
         | 
| 12 | 
            +
                        when /^6\.4/
         | 
| 13 | 
            +
                          # As of October 2014, there are no Win server releases with kernel 6.4.x.
         | 
| 14 | 
            +
                          # This case prevents future releases from resolving to nil before we
         | 
| 15 | 
            +
                          # can update the fact regexes.
         | 
| 16 | 
            +
                          os.producttype == 1 ? "10" : Facter[:kernelrelease].value
         | 
| 17 | 
            +
                        when /^6\.3/
         | 
| 18 | 
            +
                          os.producttype == 1 ? "8.1" : "2012 R2"
         | 
| 12 19 | 
             
                        when /^6\.2/
         | 
| 13 20 | 
             
                          os.producttype == 1 ? "8" : "2012"
         | 
| 14 21 | 
             
                        when /^6\.1/
         | 
    
        data/lib/facter/processor.rb
    CHANGED
    
    | @@ -4,8 +4,8 @@ | |
| 4 4 | 
             
            #   Additional Facts about the machine's CPUs.
         | 
| 5 5 | 
             
            #
         | 
| 6 6 | 
             
            # Resolution:
         | 
| 7 | 
            -
            #   Utilizes values from the processors structured fact, which itself | 
| 8 | 
            -
            #   uses various methods to collect CPU information, with implementation | 
| 7 | 
            +
            #   Utilizes values from the processors structured fact, which itself
         | 
| 8 | 
            +
            #   uses various methods to collect CPU information, with implementation
         | 
| 9 9 | 
             
            #   dependent upon the OS of the system in question.
         | 
| 10 10 | 
             
            #
         | 
| 11 11 | 
             
            # Caveats:
         | 
| @@ -37,7 +37,7 @@ Facter.add("ProcessorCount") do | |
| 37 37 |  | 
| 38 38 | 
             
              setcode do
         | 
| 39 39 | 
             
                if (processorcount = processors["count"])
         | 
| 40 | 
            -
                  processorcount | 
| 40 | 
            +
                  processorcount
         | 
| 41 41 | 
             
                else
         | 
| 42 42 | 
             
                  nil
         | 
| 43 43 | 
             
                end
         | 
    
        data/lib/facter/processors/os.rb
    CHANGED
    
    | @@ -159,7 +159,7 @@ module Facter | |
| 159 159 | 
             
                  private
         | 
| 160 160 |  | 
| 161 161 | 
             
                  def query_system_profiler
         | 
| 162 | 
            -
                    output = Facter::Core::Execution.exec("/usr/sbin/system_profiler -xml SPHardwareDataType")
         | 
| 162 | 
            +
                    output = Facter::Core::Execution.exec("/usr/sbin/system_profiler -xml SPHardwareDataType 2>/dev/null")
         | 
| 163 163 | 
             
                    plist  = CFPropertyList::List.new
         | 
| 164 164 | 
             
                    plist.load_str(output)
         | 
| 165 165 | 
             
                    parsed_xml = CFPropertyList.native_types(plist.value)
         | 
| @@ -177,6 +177,16 @@ module Facter | |
| 177 177 | 
             
                  def get_physical_processor_count
         | 
| 178 178 | 
             
                    Facter::Util::POSIX.sysctl("hw.ncpufound").to_i
         | 
| 179 179 | 
             
                  end
         | 
| 180 | 
            +
             | 
| 181 | 
            +
                  def get_processor_speed
         | 
| 182 | 
            +
                    speed = Facter::Util::POSIX.sysctl("hw.cpuspeed").to_i
         | 
| 183 | 
            +
                    if speed < 1000
         | 
| 184 | 
            +
                      "#{speed} MHz"
         | 
| 185 | 
            +
                    else
         | 
| 186 | 
            +
                      speed = speed.to_f / 1000
         | 
| 187 | 
            +
                      "#{(speed * 100).round.to_f / 100.0} GHz"
         | 
| 188 | 
            +
                    end
         | 
| 189 | 
            +
                  end
         | 
| 180 190 | 
             
                end
         | 
| 181 191 |  | 
| 182 192 | 
             
                class SunOS < Base
         | 
    
        data/lib/facter/rackspace.rb
    CHANGED
    
    | @@ -1,15 +1,18 @@ | |
| 1 | 
            -
            #  | 
| 1 | 
            +
            # Fact: rsc_<RACKSPACE INSTANCE DATA>
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            # Purpose: Determine information about Rackspace cloud instances.
         | 
| 2 4 | 
             
            #
         | 
| 3 5 | 
             
            # Resolution:
         | 
| 4 | 
            -
            #   If this is a Rackspace Cloud instance, populates rsc_ facts
         | 
| 6 | 
            +
            #   If this is a Rackspace Cloud instance, populates `rsc_` facts: `is_rsc`, `rsc_region`,
         | 
| 7 | 
            +
            #   and `rsc_instance_id`.
         | 
| 5 8 | 
             
            #
         | 
| 6 9 | 
             
            # Caveats:
         | 
| 7 | 
            -
            #   Depends on Xenstore
         | 
| 10 | 
            +
            #   Depends on Xenstore.
         | 
| 8 11 | 
             
            #
         | 
| 9 12 |  | 
| 10 13 | 
             
            Facter.add(:is_rsc) do
         | 
| 11 14 | 
             
              setcode do
         | 
| 12 | 
            -
                result = Facter::Util::Resolution.exec("/usr/bin/xenstore-read vm-data/provider_data/provider")
         | 
| 15 | 
            +
                result = Facter::Util::Resolution.exec("/usr/bin/xenstore-read vm-data/provider_data/provider 2> /dev/null")
         | 
| 13 16 | 
             
                if result == "Rackspace"
         | 
| 14 17 | 
             
                  "true"
         | 
| 15 18 | 
             
                end
         | 
| @@ -19,7 +22,7 @@ end | |
| 19 22 | 
             
            Facter.add(:rsc_region) do
         | 
| 20 23 | 
             
              confine :is_rsc => "true"
         | 
| 21 24 | 
             
              setcode do
         | 
| 22 | 
            -
                Facter::Util::Resolution.exec("/usr/bin/xenstore-read vm-data/provider_data/region")
         | 
| 25 | 
            +
                Facter::Util::Resolution.exec("/usr/bin/xenstore-read vm-data/provider_data/region 2> /dev/null")
         | 
| 23 26 | 
             
              end
         | 
| 24 27 | 
             
            end
         | 
| 25 28 |  | 
| @@ -0,0 +1,12 @@ | |
| 1 | 
            +
            # Fact: rubyplatform
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            # Purpose: Returns the platform of Ruby that facter is running under.
         | 
| 4 | 
            +
            #
         | 
| 5 | 
            +
            # Resolution: Returns the value of the `RUBY_PLATFORM` constant.
         | 
| 6 | 
            +
            #
         | 
| 7 | 
            +
            # Caveats:
         | 
| 8 | 
            +
            #
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            Facter.add(:rubyplatform) do
         | 
| 11 | 
            +
              setcode { RUBY_PLATFORM.to_s }
         | 
| 12 | 
            +
            end
         | 
    
        data/lib/facter/selinux.rb
    CHANGED
    
    | @@ -85,12 +85,12 @@ end | |
| 85 85 | 
             
            Facter.add("selinux") do
         | 
| 86 86 | 
             
              confine :kernel => :linux
         | 
| 87 87 | 
             
              setcode do
         | 
| 88 | 
            -
                result =  | 
| 88 | 
            +
                result = false
         | 
| 89 89 | 
             
                if FileTest.exists?("#{selinux_mount_point}/enforce")
         | 
| 90 90 | 
             
                  if FileTest.exists?("/proc/self/attr/current")
         | 
| 91 91 | 
             
                    begin
         | 
| 92 92 | 
             
                      if (File.read("/proc/self/attr/current") != "kernel\0")
         | 
| 93 | 
            -
                        result =  | 
| 93 | 
            +
                        result = true
         | 
| 94 94 | 
             
                      end
         | 
| 95 95 | 
             
                    rescue
         | 
| 96 96 | 
             
                    end
         | 
| @@ -101,19 +101,19 @@ Facter.add("selinux") do | |
| 101 101 | 
             
            end
         | 
| 102 102 |  | 
| 103 103 | 
             
            Facter.add("selinux_enforced") do
         | 
| 104 | 
            -
              confine :selinux =>  | 
| 104 | 
            +
              confine :selinux => true
         | 
| 105 105 | 
             
              setcode do
         | 
| 106 | 
            -
                result =  | 
| 106 | 
            +
                result = false
         | 
| 107 107 | 
             
                if FileTest.exists?("#{selinux_mount_point}/enforce") and
         | 
| 108 108 | 
             
                   File.read("#{selinux_mount_point}/enforce") =~ /1/i
         | 
| 109 | 
            -
                  result =  | 
| 109 | 
            +
                  result = true
         | 
| 110 110 | 
             
                end
         | 
| 111 111 | 
             
                result
         | 
| 112 112 | 
             
              end
         | 
| 113 113 | 
             
            end
         | 
| 114 114 |  | 
| 115 115 | 
             
            Facter.add("selinux_policyversion") do
         | 
| 116 | 
            -
              confine :selinux =>  | 
| 116 | 
            +
              confine :selinux => true
         | 
| 117 117 | 
             
              setcode do
         | 
| 118 118 | 
             
                result = 'unknown'
         | 
| 119 119 | 
             
                if FileTest.exists?("#{selinux_mount_point}/policyvers")
         | 
| @@ -124,7 +124,7 @@ Facter.add("selinux_policyversion") do | |
| 124 124 | 
             
            end
         | 
| 125 125 |  | 
| 126 126 | 
             
            Facter.add("selinux_current_mode") do
         | 
| 127 | 
            -
              confine :selinux =>  | 
| 127 | 
            +
              confine :selinux => true
         | 
| 128 128 | 
             
              setcode do
         | 
| 129 129 | 
             
                result = 'unknown'
         | 
| 130 130 | 
             
                mode = Facter::Core::Execution.exec(sestatus_cmd)
         | 
| @@ -134,7 +134,7 @@ Facter.add("selinux_current_mode") do | |
| 134 134 | 
             
            end
         | 
| 135 135 |  | 
| 136 136 | 
             
            Facter.add("selinux_config_mode") do
         | 
| 137 | 
            -
              confine :selinux =>  | 
| 137 | 
            +
              confine :selinux => true
         | 
| 138 138 | 
             
              setcode do
         | 
| 139 139 | 
             
                result = 'unknown'
         | 
| 140 140 | 
             
                mode = Facter::Core::Execution.exec(sestatus_cmd)
         | 
| @@ -144,7 +144,7 @@ Facter.add("selinux_config_mode") do | |
| 144 144 | 
             
            end
         | 
| 145 145 |  | 
| 146 146 | 
             
            Facter.add("selinux_config_policy") do
         | 
| 147 | 
            -
              confine :selinux =>  | 
| 147 | 
            +
              confine :selinux => true
         | 
| 148 148 | 
             
              setcode do
         | 
| 149 149 | 
             
                result = 'unknown'
         | 
| 150 150 | 
             
                mode = Facter::Core::Execution.exec(sestatus_cmd)
         | 
| @@ -0,0 +1,21 @@ | |
| 1 | 
            +
            # Fact: system32
         | 
| 2 | 
            +
            #
         | 
| 3 | 
            +
            # Purpose: Returns the directory of the native system32 directory.
         | 
| 4 | 
            +
            # For 32-bit ruby on 32-bit Windows, typically: 'C:\Windows\system32'.
         | 
| 5 | 
            +
            # For 32-bit ruby on 64-bit Windows, typically: 'C:\Windows\sysnative'.
         | 
| 6 | 
            +
            # For 64-bit ruby on 64-bit Windows, typically: 'C:\Windows\system32'.
         | 
| 7 | 
            +
            #
         | 
| 8 | 
            +
            # Resolution: Checks for the existence of the `sysnative` directory, otherwise
         | 
| 9 | 
            +
            # uses `system32`
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            Facter.add(:system32) do
         | 
| 13 | 
            +
              confine :kernel => :windows
         | 
| 14 | 
            +
              setcode do
         | 
| 15 | 
            +
                if File.exists?("#{ENV['SYSTEMROOT']}\\sysnative")
         | 
| 16 | 
            +
                  "#{ENV['SYSTEMROOT']}\\sysnative"
         | 
| 17 | 
            +
                else
         | 
| 18 | 
            +
                  "#{ENV['SYSTEMROOT']}\\system32"
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
            end
         | 
    
        data/lib/facter/util/macosx.rb
    CHANGED
    
    | @@ -15,7 +15,7 @@ module Facter::Util::Macosx | |
| 15 15 | 
             
              # by looking at the _name key of the _items dict for each _dataType
         | 
| 16 16 |  | 
| 17 17 | 
             
              def self.profiler_xml(data_field)
         | 
| 18 | 
            -
                Facter::Core::Execution.exec("/usr/sbin/system_profiler -xml #{data_field}")
         | 
| 18 | 
            +
                Facter::Core::Execution.exec("/usr/sbin/system_profiler -xml #{data_field} 2>/dev/null")
         | 
| 19 19 | 
             
              end
         | 
| 20 20 |  | 
| 21 21 | 
             
              def self.intern_xml(xml)
         | 
    
        data/lib/facter/util/parser.rb
    CHANGED
    
    | @@ -139,8 +139,18 @@ module Facter::Util::Parser | |
| 139 139 | 
             
              class PowershellParser < Base
         | 
| 140 140 | 
             
                # Returns a hash of facts from powershell output
         | 
| 141 141 | 
             
                def parse_results
         | 
| 142 | 
            -
                   | 
| 143 | 
            -
             | 
| 142 | 
            +
                  powershell =
         | 
| 143 | 
            +
                    if File.exists?("#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe")
         | 
| 144 | 
            +
                      "#{ENV['SYSTEMROOT']}\\sysnative\\WindowsPowershell\\v1.0\\powershell.exe"
         | 
| 145 | 
            +
                    elsif File.exists?("#{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe")
         | 
| 146 | 
            +
                      "#{ENV['SYSTEMROOT']}\\system32\\WindowsPowershell\\v1.0\\powershell.exe"
         | 
| 147 | 
            +
                    else
         | 
| 148 | 
            +
                      'powershell.exe'
         | 
| 149 | 
            +
                    end
         | 
| 150 | 
            +
             | 
| 151 | 
            +
                  shell_command = "\"#{powershell}\" -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -File \"#{filename}\""
         | 
| 152 | 
            +
                  output = Facter::Core::Execution.exec(shell_command)
         | 
| 153 | 
            +
                  KeyValuePairOutputFormat.parse(output)
         | 
| 144 154 | 
             
                end
         | 
| 145 155 | 
             
              end
         | 
| 146 156 |  |