can you share one of those functions? puppet or ru...
# puppet
b
can you share one of those functions? puppet or ruby functions? Do they do any require statements?
a
it's a puppet function, in the function, it has
require 'puppet_x/baz'
, and the change was made in the required file:
Copy code
modules/foo/lib/puppet/parser/functions/bar.rb <-- there's a require in here to the other file
modules/foo/lib/puppet_x/baz.rb <-- changes made here
b
yeah that's bad
the problem isn't that cache, more likely the code references baz.rb from another environment
you need to use
require_relative()
👍 1
a
thank you, let me try
with this, the files will be isolated well to the environment, and clearing the cache should work as expected, correct?
b
If this is a modern puppetserver/openvoxserver, yes
version 6 and older had multiple issues with environment isolation
7 and 8 should be fine
a
I'm on puppet v8
thank you so much for the help
🫡 1
oh, on a closer look, the code already has:
Copy code
$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..'))
begin
  require 'puppet_x/baz'
ensure
  $LOAD_PATH.shift
end
this is similar to
require_relative
, right? This code was there when the cache issue happened
b
this looks overly complicated
a
yep, the code is old