Class: Facter::Util::Slurm

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/util/slurm.rb

Overview

SLURM fact util class

Class Method Summary collapse

Class Method Details

.get_fact(fact) ⇒ Object



15
16
17
# File 'lib/facter/util/slurm.rb', line 15

def self.get_fact(fact)
  Facter.value(fact)
end

.read_procfs(path) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Reads the contents of path in procfs

Returns:

  • (String)


8
9
10
11
12
13
# File 'lib/facter/util/slurm.rb', line 8

def self.read_procfs(path)
  output = nil
  output = Facter::Util::Resolution.exec(['cat ', path].join) if File.exist?(path)
  return nil if output.nil?
  output.strip
end