lib/puppet/indirector/resource/ral.rb in puppet-2.6.4 vs lib/puppet/indirector/resource/ral.rb in puppet-2.6.5
- old
+ new
@@ -32,15 +32,20 @@
ral_res.to_resource
end
private
+ # {type,resource}_name: the resource name may contain slashes:
+ # File["/etc/hosts"]. To handle, assume the type name does
+ # _not_ have any slashes in it, and split only on the first.
+
def type_name( request )
- request.key.split('/')[0]
+ request.key.split('/', 2)[0]
end
def resource_name( request )
- request.key.split('/')[1]
+ name = request.key.split('/', 2)[1]
+ name unless name == ""
end
def type( request )
Puppet::Type.type(type_name(request)) or raise Puppet::Error, "Could not find type #{type}"
end