| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Thanks to Jasper Lievisse Adriaanse for the fix.
|
| |
|
|
|
|
| |
/var/lib/puppet
|
|
|
|
|
|
|
|
|
|
|
| |
Due to a bug in Ruby 1.8.7 net/http will attempt to close a connection
that wasn't successfully opened (it's nil), first checking to see if the
connection is already close, and thus raising a method missing exception.
This bug causes error messages that are confusing / misleading.
To get around this, we add a closed? method to nil such that a nil (unopened)
connection is always considered closed, allowing the real problem to be
reported.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch reverts the semantically significant parts of #2890 due to the
issues discussed on #3360 (security concerns when used with autosign,
inconsistency between REST & XMLRPC semantics) but leaves the semantically
neutral changes (code cleanup, added tests) in place.
This patch is intended for 0.25.x, but may also be applied as a step in the
resolution of #3450 (refactored #2890, add "remove_certs" flag) in Rolwf.
|
|
|
|
| |
dev-lang/php).
|
| |
|
|
|
|
| |
Thanks for Eric Sorenson for the patch.
|
|
|
|
|
|
|
|
|
|
| |
This will rarely be used, but it enables even more architectural
flexibility, such as precompiling catalogs and storing them in memcached
or equivalent. With this setup, a single host can probably serve all
catalogs and you would then just have as many compiling hosts as
needed.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
This basically allows a sysadmin to control when a client
will compile a new catalog - with this option enabled,
the client will use the cached catalog as long as it has
one, only recompiling when run with the option disabled.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following manifest:
case $var {
/match/: {
if $var =~ /matchagain/ {
}
}
}
is failing because the "=~" operators when matching sets an ephemeral
variable in the scope. But the case regex also did it, and since they
both belong to the same scope, and Puppet variables are immutables, the
scope raises an error.
This patch fixes this issue by adding to the current scope a stack
of ephemeral symbol tables. Each new match operator or case/selector
with regex adds a new scope. When we get out of the case/if/selector
structure the scope is reset to the ephemeral level we were when
entering it.
This way the following manifest produces the correct output:
case $var {
/match(rematch)/: {
notice("1. \$0 = $0, \$1 = $1")
if $var =~ /matchagain/ {
notice("2. \$0 = $0, \$1 = $1")
}
notice("3. \$0 = $0, \$1 = $1")
}
}
notice("4. \$0 = $0")
And the output is:
1. $0 = match, $1 = rematch
2. $0 = matchagain, $1 = rematch
3. $0 = match, $1 = rematch
4. $0 =
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
|
| |
|
|
|
|
|
|
| |
It would fail if a directory unexpectedly existed.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
|
| |
It was previously relying on monkey-patching the
last 'Change' instance in 'evaluate', but we removed
'evaluate', so this wasn't working any more.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
| |
We were otherwise failing whenever we tried to read
a user.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
| |
There are still a few unported tests, but it's at least
better now.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
If we were removing a field, which really only 'cron'
does, then we got an exception.
This is fixed, and now tested.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
| |
It was only apparently working with constant keys,
not, say, AST strings.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
| |
Most of it was just complicated, and the rest
useless.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
| |
This is probably a slight refactor, but only because
it fixed a bug (content not being copied over correctly
from metadata), which required that slight refactor.
Mostly this just makes the code a bit cleaner.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
| |
Also making them less likely to try to modify
the local filesystem in any way.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
| |
From email:
Some of the errors I needed to track down were actually coming from my
string interpolation branch:
* I wasn't handling "Foo ${1} bar" as a regexp back reference (and I don't like it, but hey)
* I wasn't warning about & passing on the "unneeded" backslash in strings like 'foo\"bar'
* I fumbled part of the conflict resolution with Brice's hash patch.
|
| |
|
|
|
|
|
|
| |
bucket with a non-default path.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
| |
Also making the code a bit cleaner.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is a setting that was added years ago as a backward
compatibility option and even if it still works, which
is questionable, it has no purpose any longer.
It just complicated the code and didn't do much, so it's gone
now.
Also simplified the interface of Leaf#evaluate_match, since it
was now using none of the passed-in options.
Finally, removed/migrated the last of the Selector/CaseStatement
test/unit tests.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
When checksum is a parameter corresponding to checksum_type in the filesets
rather than a checksum "strategy" the value :none should generally be computed
rather than provided. If neither a source nor contents are provided, there is
no need for a checksum and thus it should be :none; otherwise, use the provided
value (or, if it's nil, let it pass through and be replaced by the default
(:md5) in the bowels of the beast).
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
At the same time I removed all of the code in checksum
that managed tracking changes to the checksum over time.
I'll add it back in as I fix the fact that changes aren't
being tracked like the should at the moment.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Also changed the internals - we're no longer using
Resource instances with the ruby block, instead
we're using a simple new class. We had to do this
because Resource has too many methods - e.g.,
'file' returned the file name rather than
created a new resource type.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
|
|
|
| |
This is a simplistic DSL - you can create
resource types (defined resources), classes,
and nodes, and they can call functions and
create resources. Nothing else, at this point.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
|
| |
We just use the scope's environment.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
|
|
|
|
|
| |
Brice's hash implementation introduces new occurances of SQTEXT/DQTEXT which, with
string interpolation, should simply be STRING.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch moves the syntactic aspects of string interpolation up
into the lexer/parser phase, preparatory to moving the semantic
portions down to the as yet unnamed futures resolution phase.
This is an enabling move, designed to allow:
* Futures resolution in and between interpolated strings
* Interpolation of hash elements into strings
* Removal of certain order-dependent paths
* Further modularization of the lexer/parser
The key change is switching from viewing strings with interpolation
as single lexical entities (which await later special case processing)
to viewing them as formulas for constructing strings, with the internal
structure of the string exposed by the parser.
Thus a string like:
"Hello $name, are you enjoying ${language_feature}?"
internally becomes something like:
concat("Hello ",$name,", are you enjoying ",$language_feature,"?")
where "concat" is an internal string concatenation function.
A few test cases to show the user observable effects of this change:
notice("string with ${'a nested single quoted string'} inside it.")
$v2 = 3+4
notice("string with ${['an array ',3,'+',4,'=',$v2]} in it.")
notice("string with ${(3+5)/4} nested math ops in it.")
...and so forth.
The key changes in the internals are:
* Unification of SQTEXT and DQTEXT into a new token type STRING (since
nothing past the lexer cares about the distinction.
* Creation of several new token types to represent the components of
an interpolated string:
DQPRE The initial portion of an interpolated string
DQMID The portion of a string betwixt two interpolations
DQPOST The final portion of an interpolated string
DQCONT The as-yet-unlexed portion after an interpolation
Thus, in the example above (phantom curly braces added for clarity),
DQPRE "Hello ${
DQMID }, are you enjoying ${
DQPOST }?"
DQCONT is a bookkeeping token and is never generated.
* Creation of a DOLLAR_VAR token to strip the "$" off of variables
with explicit dollar signs, so that the VARIABLEs produced from
things like "Test ${x}" (where the "$" has already been consumed)
do not fail for want of a "$"
* Reworking the grammar rules in the obvious way
* Introduction of a "concatenation" AST node type (which will be going
away in a subsequent refactor).
Note finally that this is a component of a set of interrelated refactors,
and some of the changes around the edges of the above will only makes
sense in context of the other parts.
|
|
|
|
| |
Without this change, rake spec crashes with a message about feature being undefined.
|
| |
|