| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Stage[main] is created without an associated source, to which
Parser::Resource::Param objects. This patch observes that the source
attribute of both Parser::Resource and Parser::Resource::Param seem
not to be used anywhere, and removes the requirement that it be
supplied.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When generating the error message when we can't find any instances for a
search request, we were "inspect"ing the request which now contains
an environment instance which itself contains a lots of things (including
all the known resource types).
Thus it was generating a very large "reason" (ie the HTTP error string).
On some environments (ie proxied mongrel) this was too large and the
proxy would produce an error 500.
I just changed the error message to just log the indirection name and
request key (which should be enough to understand what is wrong).
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
| |
The patch for #3904 should not have been accepted; it's buggy and the use case
(supporting having nodes in ldap more than once with the same name but distinct
records) is ill-conceived.
This commit reverts the patch (a7884b47) and the previous attempt to fix it
(e6709da4), restoring the old (0.25.x) behaviour.
|
|
|
|
|
|
|
|
|
| |
* Remove hard-coded facts terminus in master
* Change facts_terminus default to 'yaml' for master and 'facter' for
everything else.
Paired-with: Matt Robinson <matt@puppetlabs.com>
Signed-off-by: Rein Henrichs <rein@puppetlabs.com>
|
|
|
|
| |
http://serverfault.com/questions/166199/puppet-md5-sum-of-string
|
|
|
|
|
|
|
| |
extlookup was adding its data files to the list of watched source files.
This causes the .pp manifests to be re-parsed whenever the .csv files
change, which is no longer necessary, as the .csv files are already
reparsed on every function call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We found the gsub! in extlookup was actually modifying the value for
extlookup_precedence, so the next node to call it just got the
interpolated value from the first run.
We did two things in the code to prevent this:
1. We returned a dup of the ast string object so that modifying it
wouldn’t change puppet’s state. We didn’t do this for all possible
return values because we depend on using the original ast array object
to do array concatenation
2. We fixed extlookup to not do a destructive gsub
Reviewed by: Jesse Wolfe
|
| |
|
|
|
|
|
|
| |
The run_mode value was incorrectly getting stored to Puppet[:mode], which
was confusing the optparser for applications that declare a --mode
parameter.
|
|
|
|
|
|
| |
My earlier #4397 patch was not aware of the parameterized class
instantiation syntax, and failed on manifests that instantiate
parameterized classes.
|
|
|
|
|
|
|
| |
The new syntax for instantiating parameterized classes was confusing the
lexer's notion of namespaces.
This is a simple fix to prevent that syntax from polluting the
namespaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AST resources.
Move type-name resolution out of Puppet::Resource into the AST resources.
Move find_resource_type out of Puppet::Resource into Scope
Thus, never pass unqualified type names to Puppet::Resource objects.
Thus, Puppet::Resource objects don't need the namespace property,
and Puppet::Resource objects never consult the harddrive to look for
.pp files that might contain their type definitions,
Thus, performance is improved.
Also removes the temporary fix for #4257 that caused #4397
(The code was too eager to look for a class in the topscope)
Paired-With: Paul Berry <paul@puppetlabs.com>
Signed-off-by: Jesse Wolfe <jes5199@gmail.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.
|
|
|
|
|
|
|
|
|
| |
When the name of a module matches the name of a file in the local
directory, puppet agent would sometimes try to read that file and
interpret it as puppet code. This happened because files.rb was
unintentionally permitting puppet files without an extension. Fixed
by changing the glob pattern to only permit ".pp" and ".rb"
extensions.
|
|
|
|
|
|
|
| |
Correctly revert damage done by c00285c, which incorrectly reverted in
a7e4fe8.
The result was that "puppet agent" and others were trying to create a
reportdir that they don't actually use.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During a profiling of a 2.6.1rc1 puppet master, I found that we
spend a lot of time and efforts in Puppet::Util::Autoload#module_directories.
Since this method is doing a bunch of filesystem access, this process is
slow.
In fact each time we were evaluating a resource or trying to find if a given
resource was a builtin type we ended up scanning the whole module directories
for the given environment.
This patch attempts to fix this performance issue by caching the module_directories
output for the either the time of the compilation or an agent configurer
run (since this stuff looks like to be shared for both compilation and
catalog evaluation).
With this patch, my compilation time for 2k resources went from 5.91s to
3.71s (second run each time to allievate parsing time)..
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Edited to fix a typo [#4434]
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
|
|
|
|
|
|
| |
This can happen under jruby with native threads.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
| |
Ruby autoloader seems to not be thread-safe. Since rack uses it to lazily
load the Rack::Request and Rack::Response classes, on jruby it fails
if the first compilation is done with multiple concurrent threads.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
| |
The underlying hash is not protected and thus two threads accessing
the cached value at the same time and one expiring the value can result
in a race condition.
This patch synchronizes the access to the value_cache underlying hash.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
| |
So let's not call it :)
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
| |
With the type collection refactoring, when accessing a fresh collection
puppet tries to import the site.pp manifest (perfrom_initial_import).
In the case of puppetdoc, we are parsing site.pp by ourselves, so we
ended parsing it twice, resulting in an "import loop detected" error.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
| |
The refactoring of using environment instances instead of strings
for initializing the parser, rdoc wasn't updated, thus was unable
to initialize the parser.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
| |
This patch promotes extlookup() to being a builtin function.
It also adds test and makes some minor tweaks to the code.
The behavior of extlookup has been left unchanged.
|
|
|
|
|
| |
optparse hasn't always had the concept of default_argv. Fortunately, we
don't really need it.
|
|
|
|
|
|
|
|
|
|
|
| |
We were sending an incorrect (containing a //) url for sourced file
content since the file streaming patches.
Depending on the webserver in front of puppet it could fail (for instance
nginx+mongrel).
This patch fixes the offending // in each sourced file urls.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
| |
I almost changed this to correspond to the lexer pattern ([a-z0-9][-\w]*) but
that isn't quite right either (it would reintroduce the '::' problem). Another
option I considered was [^\[]+, but that has it's own problems. In the end I
just made the minimal change, adding '-' to the acceptable characters.
|
| |
|
|
|
|
|
| |
Single quoted used to allow escape on single quotes and pass all other
characters through without comment; now the do again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we were clearing the thread variable containing the compiler's reference
to it's environment's known resource types at the start of each compile the
reference remaining at the end of a compilation could never be used and was
thus just garbage that we were arbitrarily retaining.
This patch moves the clearing of the thread var to the _end_ of compilation so
that it's always nil except in the middle of a compile.
This raises an interesting question; should the ref just live on the compiler
object and we could dispense with the thread-var? It might require things that
now only know about the environment to need a ref to the compiler and introduce
other thread issues (e.g. we might just end up needing a :current_compiler
thread variable, for no net gain in simplicity).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each time the compiler was accessing the loaded types, we were checking if the
manifests had changed. This incurred a large performance cost compared to 0.25
and introduced race conditions if manifests changed while a thread was in the
middle of a compilation.
This tentative fix, based on Brice's, makes sure each thread will get access to
the same loaded types collection for the durration of a compilation, even if
the manifests change. We now only check for changed files at the start of a
compilation or if the environment changes, and we maintain a per environment
thread lock so that only one thread at a time can be reloading any particular
environment (and the need-check is done inside the synchronize block so that
only the first will actually load it).
As long as the manifests don't change, the threads will share the same collection,
so there is only duplication in memory for a brief window surrounding a change.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Second-author: Markus Roberts <markus@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
In retrospect it appears that the fix for #4270 was incomplete and somewhat off
target. This patch fixes the one demonstrably incorrect part (the namespace)
and adds a comment outlining what remains to be done to clean up the code;
these additional changes, while needed for maintanability, are inappropriate
for a quick turnaround crucial bug fix release such as 2.6.1, at which this
patch is targeted.
|
|
|
|
|
|
|
|
|
| |
< and > might be invalid or borderline chars to use for a file name
or an url.
This patch changes those characters to __.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
| |
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resources mark themselves as evaluated to prevent being evaluated
again. Unfortunately, they were not marking themselves until after
they had finished being completely evaluated. Thus, there was
nothing actually stopping recursive evaluations. This patch just
makes resources mark themselves as evaluated when they start
evaluating, and adds tests.
The original setting of evaluated was done in an ensure block, so
this doesn't change the behavior of a resource which fails to
evaluate. The only places evaluated? is checked aren't affected
by this change, as they wouldn't want to evaluate it when it's
already being evaluated anyway.
|
|
|
|
|
|
|
|
|
|
| |
As Brice discovered, the problem was that we simply ignored empty classes in
the graph when determining application order. This patch instead replaces them
with a resource of a new type which we've frequently noted the (internal) need
for: a whit, the smallest possible resource, which has no properties or other
semantics apart from its existence and its name.
This resource then ensures application order through the normal mechanisms.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is that the environment list gets cleared
when Settings#set_value is called, and it was being
called every time Settings#use was called, which is
more often than obvious but especially if reporting
is enabled.
Previously we ignored noop when running inside of Settings,
and this essentially adds that back in, so we can remove
the special noop behaviour in Settings itself.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
| |
This fixes double-quoted strings to interpolate undef variables
as an empty string. This is the behavior present in 0.25.x.
|
|
|
|
|
|
|
|
|
| |
Parent classes were getting searched for in a way that fails if they
were not already loaded into an environment. This patch replaces that
codepath with a call that will load them if they are needed.
This bug was masked by another bug that loads all classes into
"production", whether they are used there or not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ticket #4238 introduced a problem that a function couldn't compare to
another value until after it was evaluated, and AST::Function didn't have the
evaluate_match method. This change moves that method from AST::Leaf to AST.
The special casing necessary for doing comparisons between AST objects
feels messy and could probably be encapsulated better. I've created
ticket #4291 to remind us to refactor this at some point.
Paired with: Nick Lewis
Signed-off-by: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
| |
The tweak to the fix for #4233 was too narrow, and precluded the possibility
that a type name would contain colons e.g. (MySQL::User)
|
|
|
|
|
|
|
| |
We sometimes refer to the namevar as its name and sometimes as :name; there is
no consistant pattern in the code for when this is done one way or the other.
This problem was exposed by the composite namevar refactor; the present patch
adjusts the crucial routine to work with either.
|
|
|
|
|
|
|
| |
With the title carrying semantic information it may contain arbitrary chars;
when parsing a ref we only want word chars in the type (up to the first open
square bracket) and everything else, enclosed in "[" / "]" to the end of the
string, is the title.
|
|
|
|
|
|
|
|
| |
be multiline
Puppet allows resource titles to contain newlines. We recently
introduced several regexps that were failing on resources with multiline
titles.
|
|
|
|
|
|
| |
The loop detection mechanism isn't great (it should, for example, allow nesting
if the signatures differ) but the key problem was that the ensure was simply
backwards.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a modification of the Nick/Jesse/Matt patch, retaining their tests and
the analysis of the problem but reversing the implementation direction of the
solution.
Rather than trying to make the already somewhat brittle slurpstring smarter,
which requires telling it what following strings will be accepted by the caller
with a zero-width-lookahead negation of the regular expression used to extract
a variable name, this patch keeps that responsibility in the caller where it
belongs.
The caller (tokenize_interpolated_string) now checks to see if it got a
variable name _before_ emitting a variable token; if it got one, it proceeds
normally, but if it didn't it simply tries again from that point in the string
(accumulating the false match as a prefix). This change actually simplifies
the logic of tokenize_interpolated_string somewhat.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The comparisons operator (and more particularly == and !=) were not treating
the undef value as '', like case and selector did since #2818.
This patch makes sure comparison operator uses AST leaf matching.
Unfortunately, doing this introduces a behavior change compared to
the previous versions:
Numbers embedded in strings will now be matched as numbers in case and
selector statements instead of string matching.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|