File.dirname(path) could be converted to a Puppet::FileSystem.dir(path)