Sha256: 1cce1bffa471d255c3eb6920b4dc30c2fd0ffdb3ddc5adc81ddfc47c347c3982

Contents?: true

Size: 967 Bytes

Versions: 91

Compression:

Stored size: 967 Bytes

Contents

module Facter::Util::Partitions
  module OpenBSD
    def self.list
      Facter::Core::Execution.exec('df').scan(/\/dev\/(\S+)/).flatten
    end

    # On OpenBSD partitions don't have a UUID; disks have DUID but that's not
    # compatible.
    def self.uuid(partition)
      nil
    end

    def self.mount(partition)
      scan_mount(/\/dev\/#{partition}\son\s(\S+)/)
    end

    # Reported size is in 1K blocks
    def self.size(partition)
      scan_df(/\/dev\/#{partition}\s+(\S+)/)
    end

    def self.filesystem(partition)
      scan_mount(/\/dev\/#{partition}\son\s\S+\stype\s(\S+)/)
    end
   
    # On OpenBSD there are no labels for partitions
    def self.label(partition)
      nil
    end

    private
    def self.scan_mount(scan_regex)
      Facter::Core::Execution.exec('mount').scan(scan_regex).flatten.first
    end

    def self.scan_df(scan_regex)
      Facter::Core::Execution.exec('df -k').scan(scan_regex).flatten.first
    end
  end
end

Version data entries

91 entries across 91 versions & 2 rubygems

Version Path
facter-2.5.7 lib/facter/util/partitions/openbsd.rb
facter-2.5.7-x86-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.7-x64-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.7-universal-darwin lib/facter/util/partitions/openbsd.rb
facter-2.5.6-x86-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.6-x64-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.6-universal-darwin lib/facter/util/partitions/openbsd.rb
facter-2.5.6 lib/facter/util/partitions/openbsd.rb
facter-2.5.5-x86-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.5-x64-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.5-universal-darwin lib/facter/util/partitions/openbsd.rb
facter-2.5.5 lib/facter/util/partitions/openbsd.rb
facter-2.5.4-x86-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.4-x64-mingw32 lib/facter/util/partitions/openbsd.rb
facter-2.5.4-universal-darwin lib/facter/util/partitions/openbsd.rb
facter-2.5.4 lib/facter/util/partitions/openbsd.rb
bolt-0.24.0 vendored/facter/lib/facter/util/partitions/openbsd.rb
bolt-0.23.0 vendored/facter/lib/facter/util/partitions/openbsd.rb
bolt-0.22.0 vendored/facter/lib/facter/util/partitions/openbsd.rb
bolt-0.21.8 vendored/facter/lib/facter/util/partitions/openbsd.rb