| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
You can reproduce the error with a simple manifest
Bogus_type <| title == 'foo' |>
We used to fail because find_resource_type returned nil and we never
checked if it was nil before calling methods on it.
Reviewed-by: Max Martin <max@puppetlabs.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit e3c59df2b246fe5e764272f21b631a5d2f28687f.
This commit is being reverted because the solution is incomplete, and a better
solution is out of scope for this release. A more complete solution will be
implemented in the future.
|
|/
|
|
|
|
|
| |
Older version control systems like CVS and SVN used to use these $Id$
tags for version information.
Paired-with: Nick Lewis
|
|
|
|
|
|
|
|
|
| |
function(-1) was failing because the grammar wasn't allowing negated values in
function calls. This fix makes the negation of any value which was previously
legal as a function argument also now legal as a function argument.
Paired-With: Max Martin
Paired-With: Markus Roberts
|
|\
| |
| |
| | |
parser.rb manually rebuilt to resolve global grammer chances.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following manifest was failing:
$hash = { 'a' => { 'b' => { 'c' => 'it works' } } }
$out = $hash['a']['b']['c']
because of a typo in the grammar.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| | |
The automatically generated parser.rb needed to be rebuilt to make the syntax
changes functional; this commits only that rebuild.
|
|\ \
| | |
| | |
| | | |
bug/2.6.next/5516-hashes-can't-be-used-in-selectors
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following manifest was producing a parse error:
$int = { 'eth0' => 'bla' }
$foo = $int['eth0'] ? {
'bla' => 'foo',
default => 'bleh'
}
because selectors didn't support hash access.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|\ \
| | |
| | |
| | | |
bug/2.6.next/5720-puppetdoc-fails-on-parameterized-class
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It appears that the fix for #5252 wasn't complete, and class, nodes and
definition were still using the current lexer line number instead of
the line number of the class/define/node token.
This combined with some missing comments stack pushing/pop on parenthesis
prevented puppetdoc to correctly get the documentation of some class (including
parametrized ones).
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following manifest was crashing puppetdoc:
class test {
include "test::$operatingsystem"
}
Because the quoted string is "rendered" as a concat AST, which in turn
ended being an array when entering RDoc.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| | |
* Repaired a 2-indent/4-indent issue that kept a code block from being recognized
* Wrapped literal strings in backticks to format as code and protect from Markdown
* Added note about backslashes for escaping metacharacters.
|
|/
|
|
|
|
| |
* Fixed ULs being interpreted as code blocks
* Changed an example for variety.
* Turned set of paragraphs inside a LI into a nested list.
|
|\
| |
| |
| |
| | |
* tickets/2.6.x/5564:
Fixed #5564 - Added some more fqdn_rand documentation
|
| |
| |
| |
| | |
Reviewed-by: Paul Berry <paul@puppetlabs.com>
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
* ticket/2.6.next/5045:
(#5045) Cleaning up some tests and code
(#5045) External node classifiers should be able to specify params for classes
(#5045) Adds support to resource/type to also accept a param hash
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Renamed some variables to be clearer, made tests use less stubbing,
added some additional tests and got rid of some unecessary logic.
Paired-with: Dan Bode
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It facilitates the support for param classes from the ENC. It adds
support for classes to be passed as a hash to the evaluate_classes
method. If a hash of classes is specified, it also evaluates duplicates.
I also had to convert the hash to an array for tags to be applied
correctly.
Reviewed-by: Matt Robinson
|
| | |
| | |
| | |
| | |
| | |
| | | |
supported use of this function.
Final patch in this series reviewed by Dan Bode.
|
| | |
| | |
| | |
| | | |
Fixing use of define/declare; editing for clarity.
|
|/ /
| |
| |
| | |
The differences in the way defined() handles different types of entities weren't well-explained. Documentation was also added for the behavior of defined(Node["somenode.domain.com"]).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ruby's default #inspect method can lead to printing factorial-order
output for large graphs of objects. Since we have large graphs of
objects, this is not optimal.
This patch replaces a few well-connected objects' #inspect methods with
methods that produce reduced output, and are thus much faster.
Paired-With: Nick Lewis <nick@puppetlabs.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From the spec directory I found all the specs that fail when run on their own.
for TEST in `find . -name "*.rb" -type f`; do
spec $TEST > /dev/null 2>&1
if [[ $? != 0 ]]; then
echo $TEST
fi
done
All of them were cases of missing requires.
Paired-with: Nick Lewis <nick@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the responsibility for type-name resolution was moved to the AST nodes in
commit 449315a2c705df2396852462a1d1e14774b9f117, at least one instance was
missed: the space ship operator
Myclass <<| tag == foo |>>
fails unless Myclass has been previously loaded. This commit adds the lookup
to AST::Collection nodes in the same way it was added to the other node types.
Note that I haven't audited the other note types for similar cases.
|
|
|
|
| |
My code smell routines bobbled this one, so I'm fixing it manually.
|
|
|
|
|
|
|
| |
The autoloading is not thread safe, which means two threads could both
autoload the same function at the same time.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is a resurgence of #2366 that appeared because of the commit
8971d8.
Before this commit, for associating documentation comments, we
were preferring line numbers coming from the parser currently reducing rule,
instead of the current lexer line number (which can be in advance
of several tokens due to the nature of LALR parsers).
We now merge the ast line number before fetching the comment from the
lexer.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Accesing an array with an integer index (ie $array[1]) is producing
a ruby error: can't convert String into Integer
This is because the array index is not properly converted to an number
before the array element lookup is performed.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a reconciliation/melding of Paul's
(#4534) Class inheritance with parameterized classes is no longer ignored
and Markus's
Fix for #4778 -- evaluate parameterized classes when they are instantiated
Extracted the code from Resource::Type#mk_plain_resource that evaluates
parents and tags the catalog, and moved that into a new method called
instantiate_resource. Instantiate_resource is now also called from
Parser::Ast::Resource#evaluate, so that the notation
"class { classname: }"
now executes this code too. Likewise adds class evaluation so that it behaves
the same (with regard to lazy / strict evaluation) as
include classname
|
|
|
|
|
|
|
|
|
|
|
| |
This was a regression, not covered by a test; previously the string
"foo\
bar"
would be interpreded as "foobar" but this was changed to "foo\\\nbar" in
2.6.x with my string interpolation refactor. This change restores the
behaviour.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The evaluate_definitions method was first figuring out which resources
needed to be evaluated (using unevaluated_resources), and then
evaluating them one by one. As a result, if evaluating one resource
triggered another resource to be evaluated, the latter resource could
get evaluated twice. This bug could occur, for example, if both
resources were classes that were included into the node by an external
node classifier, and if the first of the two classes included the
second.
Modified Resource#evaluate to be idempotent.
Also added an integration test to verify the fix.
|
|
|
|
|
|
|
|
| |
Part of the ongoing refinement / cleanup of the string interpolation semantics.
When scanning for an unescaped string terminator we now also allow an 0 or more
pairs of backslashes (that is, escaped backslashes) before the terminator.
Thanks to Jacob for the test I should have added.
|
|
|
|
|
| |
This is another case where our test objects were overly mocked so they
didn't alert us to problems with our implementation.
|
|
|
|
|
|
|
|
|
|
| |
The :undef symbol, which we use internally to distinguish between
undefined variables and variables whose value is the empty string, is
being leaked in calls to functions (e.g. "split"). This is a
departure from 0.25.x behavior, where undefined variables evaluated to
"".
This patch restores the 0.25.x behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Made the following modifications to ResourceTypeAPI:
(1) returned nil from “define”, “hostclass”, and “node”.
(2) renamed “mk_resource_type” and “munge_type_arguments” to
“__mk_resource_type__” and “__munge_type_arguments__” to discourage
customers from calling them.
(3) Made ResourceTypeAPI a class rather than a module, and changed the
parser to evaluate the contents of pure ruby manifests using a
instances of this class.
(4) Changed ResourceTypeAPI to insert newly instantiated types into
Thread.current[:known_resource_types] rather than the default
environment's known_resource_types.
This effectively backports the fix for issue #4657 to 2.6.x.
Also backported the new spec tests from #4657.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function import_if_possible, which was supposed to be responsible
for making sure that no two threads tried to import the same file at
the same time, was not making this decision based on the full pathname
of the file, since it was being invoked before pathnames were
resolved. As a result, if we attempted to import two distinct files
with the same name at the same time (either in two threads or in a
single thread due to recursion), one of the files would not always get
imported.
Fixed this problem by moving the thread-safety logic to happen after
filenames are resolved to absolute paths. This made it possible to
simplify the thread-safety logic significantly.
|
|
|
|
|
|
|
| |
This is a minimal fix for #4631 by reversing one part of the refactor for #1903
commit 0d4fd60c7c143cc1f4e4b0f99f359c09cbfbf21e. It fixes the immediate issue
(implicit classes not being added to resources) but leaves open several other
questions which are defered to #4687.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
My fix for #4542 was overly enthusiastic about assuring that all resources had
a stage, resulting in stages designations being serialized for resources in
manifests which did not use resources (everything was in implicit main). This
broke 0.25.x compatibility, as all catalogs now refered to stages.
This patch scales back the change for #4542 slightly, supressing the setting of
main on the puppetmaster and relying on the default behaviour on the client (for
2.6.x and later, treat it as main; for 0.25.x, do nothing).
|
| |
|
|
|
|
|
|
| |
This commit unifies the code paths on which classes are added, alters the default
stage to respect the stage of the parent if any, and assures that the resource is
notified if its stage is assigned (turning an implicit stage into an explicit one).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the rest of the change for #4303; James and I discussed various
ways the solution to that ticket needed to be extended but, as neither of us
committed code, nothing changed. This is the least implact extension, which
mimics the behaviour of prior versions.
It leaves open the question: should '\\x' start with a single or double
backslash? If, as now, '\\x' starts with a double backslash (i.e. single quote
is the only escapable characterin single quoted strings) a string ending in a
backslash can not be represented in a single quoted string.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|