class Puppet::Util::NetworkDevice::Config

Attributes

devices[R]

Public Instance Methods

exists?() click to toggle source
# File lib/puppet/util/network_device/config.rb, line 17
def exists?
  Puppet::FileSystem.exist?(@file.to_str)
end
read(force = false) click to toggle source

Read the configuration file.

# File lib/puppet/util/network_device/config.rb, line 30
def read(force = false)
  return unless exists?

  parse if force or @file.changed?
end

Public Class Methods

devices() click to toggle source
# File lib/puppet/util/network_device/config.rb, line 11
def self.devices
  main.devices || []
end
main() click to toggle source
# File lib/puppet/util/network_device/config.rb, line 7
def self.main
  @main ||= self.new
end
new() click to toggle source
# File lib/puppet/util/network_device/config.rb, line 21
def initialize
  @file = Puppet::Util::WatchedFile.new(Puppet[:deviceconfig])

  @devices = {}

  read(true) # force reading at start
end