Class: SlashPort::Component::Puppet

Inherits:
SlashPort::Component show all
Defined in:
app/models/components/puppet.rb

Instance Method Summary collapse

Methods inherited from SlashPort::Component

#_want, attribute, attributes, #attributes, class_initialize, components, config, #configs, configs, disable, enable, #get_attributes, get_attributes, #get_configs, get_configs, #get_things, get_things, inherited, is_enabled?, label, #path

Instance Method Details

#freshnessObject



9
10
11
12
13
14
15
16
17
18
# File 'app/models/components/puppet.rb', line 9

def freshness
  begin
    tuple = SlashPort::Tuple.new
    age = Time.now - File.stat("/var/puppet/state/state.yaml").mtime
    tuple.data["freshness"] = age.to_f
    return tuple
  rescue Errno::ENOENT
    return nil
  end
end