Method: Puppet::Indirector::JSON#path
- Defined in:
- lib/puppet/indirector/json.rb
#path(name, ext = '.json') ⇒ Object
Return the path to a given node’s file.
41 42 43 44 45 46 47 48 49 |
# File 'lib/puppet/indirector/json.rb', line 41 def path(name, ext = '.json') if name =~ Puppet::Indirector::BadNameRegexp then Puppet.crit(_("directory traversal detected in %{json}: %{name}") % { json: self.class, name: name.inspect }) raise ArgumentError, _("invalid key") end base = data_dir File.join(base, self.class.indirection_name.to_s, name.to_s + ext) end |