[PATCH/puppet 1/1] [#4344] Temporary fix to stop agent from importing modules

1 view
Skip to first unread message

Nick Lewis

unread,
Jul 27, 2010, 6:12:47 PM7/27/10
to puppe...@googlegroups.com
Due to type collection madness, agent tries to import modules
to resolve resource types. That is wrong, decreases performance,
and causes problems. This patch forces agent to not import any
files by setting ignoreimport to true.

Signed-off-by: Nick Lewis <ni...@puppetlabs.com>
---
lib/puppet/application/agent.rb | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index f0e7f4d..2b75505 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -219,6 +219,10 @@ class Puppet::Application::Agent < Puppet::Application

Puppet.settings.use :main, :agent, :ssl

+ # Always ignoreimport for agent. It really shouldn't even try to import,
+ # but this is just a temporary band-aid.
+ Puppet[:ignoreimport] = true
+
# We need to specify a ca location for all of the SSL-related i
# indirected classes to work; in fingerprint mode we just need
# access to the local files and we don't need a ca.
--
1.7.2

Matt Robinson

unread,
Jul 27, 2010, 7:35:07 PM7/27/10
to puppe...@googlegroups.com
+1

My initial reaction was that there should be some form of test, but
agree that it would be very hard to meaninfully test in rspec without
firing up an agent, and found there's already a test for what I most
care about being tested with this change.

spec/unit/parser/type_loader_spec.rb
it "should return immediately when imports are being ignored" do
Puppet::Parser::Files.expects(:find_manifests).never
Puppet[:ignoreimport] = true
@loader.import("foo").should be_nil
end

> --
> You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
> To post to this group, send email to puppe...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
>
>

Luke Kanies

unread,
Jul 28, 2010, 12:18:20 PM7/28/10
to puppe...@googlegroups.com
As discussed in person yesterday, this fix is fine but I think there's
a better fix up the code path - just moving all of the lookup code out
of the main code paths, and essentially only doing them when an AST
resource produces a Parser resource.

--
http://puppetlabs.com/ | +1-615-594-8199 | @puppetmasterd

Reply all
Reply to author
Forward
0 new messages