summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam S <asa188@sfu.ca>2015-09-25 17:58:05 -0700
committerAdam S <asa188@sfu.ca>2015-09-25 18:06:00 -0700
commit440245d40d90f5f5cd9d7db0131371969216e55c (patch)
treeb4a9c1f5a202d76393522036bca87a8e225d332a
parent4d1bca3359519e6303d9b3543c56426606c8eba3 (diff)
downloadpuppet-stdlib-440245d40d90f5f5cd9d7db0131371969216e55c.tar.gz
puppet-stdlib-440245d40d90f5f5cd9d7db0131371969216e55c.tar.bz2
fixup-PR#506 Speed improvements in facter resolution
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.
-rw-r--r--lib/facter/service_provider.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/facter/service_provider.rb b/lib/facter/service_provider.rb
index 54db937..a117921 100644
--- a/lib/facter/service_provider.rb
+++ b/lib/facter/service_provider.rb
@@ -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