lib/puppet/indirector/json.rb
# Return the path to a given node's file.
Return the path to a given node's file.
Return the path to a given node ' s file .
def path(name, ext = '.json')
    if name =~ Puppet::Indirector::BadNameRegexp then
      Puppet.crit("directory traversal detected in #{self.class}: #{name.inspect}")
      raise ArgumentError, "invalid key"
    end
    base = Puppet.run_mode.master? ? Puppet[:server_datadir] : Puppet[:client_datadir]
    File.join(base, self.class.indirection_name.to_s, name.to_s + ext)
  end
def path ( name , ext = '.json' ) if name =~ Puppet :: Indirector :: BadNameRegexp then Puppet . crit ( "directory traversal detected in #{self.class}: #{name.inspect}" ) raise ArgumentError , "invalid key" end base = Puppet . run_mode . master? ? Puppet [ :server_datadir ] : Puppet [ :client_datadir ] File . join ( base , self . class . indirection_name . to_s , name . to_s + ext ) end
Return the path to a given node's file.
Return the path to a given node ' s file .
name
<not_specific>
ext
<not_specific>