Class: Facter::Util::Globus

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

Overview

Util class for Globus facts

Class Method Summary collapse

Class Method Details

.infoObject



5
6
7
# File 'lib/facter/util/globus.rb', line 5

def self.info
  '/var/lib/globus-connect-server/info.json'
end

.info_exists?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/facter/util/globus.rb', line 9

def self.info_exists?
  File.exist?(info)
end

.read_infoObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/facter/util/globus.rb', line 13

def self.read_info
  return nil unless info_exists?

  f = File.read(info)
  return nil if f.nil?

  value = nil
  begin
    value = JSON.parse(f)
  rescue JSON::ParserError
    return nil
  end
  value
end