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:

Refactor #13678

Facter should implement its own which command

Added by Stefan Schulte about 4 years ago. Updated almost 4 years ago.

Status:ClosedStart date:04/06/2012
Priority:NormalDue date:
Assignee:-% Done:


Target version:1.6.10
Keywords: Affected Facter version:

We've Moved!

Ticket tracking is now hosted in JIRA:


Currently Facter::Util::Resolution.exec relies on which to check if a command can be executed. This basically means that for every command we want to execute, we fork a second time just to execute which.

Facter should implement its own which command so we don’t need to invoke the shell all the time. Puppet already has some similar methods we may be able to port to facter.

Related issues

Related to Facter - Bug #5013: Facter assumes path that isn't there always Accepted 10/15/2010
Related to Facter - Bug #12831: recursion on fact resultion: kernel Closed 02/25/2012
Related to Puppet - Bug #12980: Puppet::Util.execute on Windows should search 64-bit path... Accepted 03/06/2012
Related to Facter - Bug #20054: virtual facts show error about gsub on nil Closed


#1 Updated by Stefan Schulte about 4 years ago

  • Tracker changed from Feature to Refactor

#2 Updated by Stefan Schulte about 4 years ago

  • Assignee set to Stefan Schulte
  • Branch set to

I’ve written something that will currently pass all tests but I still have to add a few additional test cases

#3 Updated by Stefan Schulte about 4 years ago

  • Category set to library
  • Status changed from Unreviewed to In Topic Branch Pending Review
  • Assignee deleted (Stefan Schulte)
  • Branch changed from to

#4 Updated by Anonymous almost 4 years ago

We took a look at the pull request, everything looks good. It merged cleaning and all the tests still run. Just waiting to see if anyone has any additional feedback before we merge this into 1.6.x.

#5 Updated by Jeff Weiss almost 4 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version set to 1.6.10

#6 Updated by Ken Barber almost 4 years ago

Stefan thanks very much for all your great work on this – its a very awesome change indeed and I appreciate your patience and attitude towards getting this ‘just right’.

Jeff – I don’t know if you have noticed, but there is a number of marked deprecations and warnings in this code that may warrant future deprecation. Not sure when (as in what version) you want to achieve this, but they may warrant tickets for tracking.

#7 Updated by Moses Mendoza almost 4 years ago

  • Status changed from Merged - Pending Release to Closed

Released in 1.6.10.

Also available in: Atom PDF