The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Bug #7444

Ability to load a server side function from a server side function broken.

Added by Trevor Vaughan over 4 years ago. Updated over 2 years ago.

Status:ClosedStart date:05/09/2011
Priority:NormalDue date:
Assignee:-% Done:


Target version:2.7.6
Affected Puppet version:2.6.6 Branch:
Keywords: customer

We've Moved!

Ticket tracking is now hosted in JIRA:


In 0.24.9, the preferred way of loading a server side function to be used within another server side function was to do the following:

require File.join([File.expand_path(File.dirname(FILE)), ‘filename.rb’])

In 2.6.6, this does not work as Puppet attempts to load the file multiple times and the puppet run will not continue due to a duplicate load attempting to happen.

I’ve worked around this by doing the following, but it’s definitely a hack:

begin function_filename(‘%test_$string‘) rescue require File.join([File.expand_path(File.dirname(FILE)), 'filename.rb’]) end

In the called function, I just add something to return ‘true’ if that string is passed. Massive hack, but I couldn’t figure out another way to do it more elegantly.


#1 Updated by Anonymous over 4 years ago

  • Status changed from Unreviewed to Accepted

#2 Updated by Anonymous about 4 years ago

  • Status changed from Accepted to Needs More Information
  • Assignee set to Anonymous
  • Target version set to 2.7.5

G'day Trevor.

I believe that this issue has been fixed by the code merged into 2.7.x at The individual commit fixing this is

At this point you should be able to invoke function_whatever and it will autoload appropriately for the environment with no additional work on your part.

Could you test that and confirm that it does fix your problem? I just want to double-check that before closing the ticket.



#3 Updated by Michael Stahnke about 4 years ago

  • Target version changed from 2.7.5 to 2.7.6

This appears to be fixed in #4549 . What is the status of this ticket?

#4 Updated by Michael Stahnke about 4 years ago

  • Target version changed from 2.7.6 to 2.7.x

#5 Updated by James Turnbull about 4 years ago

  • Category set to functions
  • Status changed from Needs More Information to Closed

Fixed as dup of #4549.

#6 Updated by Matthaus Owens almost 4 years ago

  • Target version changed from 2.7.x to 2.7.6

#7 Updated by Charlie Sharpsteen over 2 years ago

  • Keywords set to customer

#9 Updated by Anonymous over 2 years ago

  • Assignee deleted (Anonymous)

Also available in: Atom PDF