]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
fixup-PR#506 Speed improvements in facter resolution
authorAdam S <asa188@sfu.ca>
Sat, 26 Sep 2015 00:58:05 +0000 (17:58 -0700)
committerAdam S <asa188@sfu.ca>
Sat, 26 Sep 2015 01:06:00 +0000 (18:06 -0700)
This is to improve speed on Facter resolution of service_provider fact
that was just introduced in PR# 506.  The improvements go from 280ms
resolution time approx. down to 2ms resolution time approx. by adding
requires statements.

lib/facter/service_provider.rb

index 54db937d279c424e09f9c9ea7b4173755a5b571e..a11792115c87337d7abda989ce490f68ea82901d 100644 (file)
@@ -7,6 +7,9 @@
 #
 # Caveats:
 #
+require 'puppet/type'
+require 'puppet/type/service'
+
 Facter.add(:service_provider) do
   setcode do
     Puppet::Type.type(:service).newservice(:name => 'dummy')[:provider].to_s