| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
semicolons
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While evaluating the AST, catalog vertices are not always ordered
the same way on different run, leading to some tags (which should
have been applied in evaluation order) to not be associated with
some underlying resources.
This changeset change all accesses to resources inside the compiler
to always use an ordered (in evaluation order) list of added
resources.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
lib/puppet/indirector/facts/facter.rb
lib/puppet/provider/augeas/augeas.rb
lib/puppet/util/filetype.rb
spec/unit/indirector/facts/facter.rb
spec/unit/provider/augeas/augeas.rb
test/util/filetype.rb
|
| | |
|
| | |
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
CHANGELOG
spec/unit/type/file/selinux.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was caused by the fix to #1472. That fix unexported
any resources collected from the local catalog.
The crux of this fix is that it separates 'exported'
and 'virtual' a bit more. It also removes no-longer-needed
functionality where resources copied their virtual or
exported bits from the enclosing define or class. This is
now obsolete because we don't evaluate virtual defined resources.
The crux of this commit is that defined resources can stay
exported even though they're evaluated, and that exported state
won't inherit to contained resources such that those then don't
get evaluated.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Mostly renaming 'obj' to 'resource', since the whole
'obj' thing is a holdover from before we had the
term 'resource'.
Also pulling a bit of code out of a loop, since it
didn't need to be there.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following snippet:
realize( File["/tmp/a","/tmp/b"] )
is parsed into:
AST::Function @name=realize @arguments=
AST::ASTArray @children = [
AST::ResourceReference @title= AST::ASTArray @children = [
String(/tmp/a), String(/tmp/b)
]
]
When evaluated:
ResourceReference gives -> [ File[/tmp/a], File[/tmp/b] ]
which means the function arguments are:
[[File[/tmp/a], File[/tmp/b]]
after evaluating the @arguments ASTArray of AST::Functions.
Then the collector complains that it can't find the resource
because it is not supposed to work on non-flattened resource
array.
The fix is to flatten in the realize function (although it can
be done more generally in the AST::Function evaluation) before
the resources are given to the Collector.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following manifest:
$groups = ["foo", "bar"]
$type_groups = ["baz", "quux"]
$user_groups = [$groups, $type_groups]
notify{ $user_groups: }
which outputs:
notice: foo
notice: //Notify[foobar]/message: defined 'message' as 'foo'
notice: baz
notice: //Notify[bazquux]/message: defined 'message' as 'baz'
is not equivalent to
$user_groups = [ ["foo", "bar"], ["baz", "quux"] ]
notify{ $user_groups: }
which outputs:
notice: foo
notice: //Notify[foo]/message: defined 'message' as 'foo'
notice: baz
notice: //Notify[baz]/message: defined 'message' as 'baz'
notice: bar
notice: //Notify[bar]/message: defined 'message' as 'bar'
notice: quux
notice: //Notify[quux]/message: defined 'message' as 'quux'
Obviously the second one manages to flatten the arrays and not the
first one.
This changeset adds flattening to the resource titles evaluations
in order to be consitent in all cases.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Revert "Fix #1682 - ASTArray should flatten product of evaluation of its children"
This reverts commit c7ccc4ba7c42d56595564491ae578a1604c628d1.
Bug #1824 and #1922 proved the fix for #1682 and #1691 was wrong.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The rationale behind this patch is that it takes a lots of time
to let rails unserialize the ParamValue and ResourceTag object
on each compilation, just to throw them away the second after.
The idea is to fetch directly (and batched host per host) the
parameters and tags from the database and then returns them as
hash.
This allows the no-modification case to takes at least 2 times
less than before.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| | |
Converting to a Resource catalog for transmission,
then converting to a RAL catalog on the client.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The rationale behind this patch is that it takes a lots of time
to let rails unserialize the ParamValue and ResourceTag object
on each compilation, just to throw them away the second after.
The idea is to fetch directly (and batched host per host) the
parameters and tags from the database and then returns them as
hash.
This allows the no-modification case to takes at least 2 times
less than before.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There are unfortunately no tests for this patch; the Rails
code is disappointingly low on tests as it is, and it would
have been essentially an herculian effort add all of the necessary
tests just to make sure this worked.
I've verified it works in practice, which should be sufficient for now.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This allows you to specify that a metaparameter is undef
inside a definition and keep any parameters from being
inherited from the parent.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| | |
indentation of doc strings must be retained.
Signed-off-by: Thomas Bellman <bellman@nsc.liu.se>
|
| |
| |
| |
| | |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| | |
Some invalid numbers were treated as numbers and conversion to Integer
was failing returning 0 (for instance 0.24.7).
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| | |
Also uses Puppet::Resource's method for creating
transportable resources.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|/
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This involves lexing '::class' tokens along with correctly
looking them up from the Resource::Reference class.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
| |
The aim is to let --parseonly succeeds even if the function
is not (yet) present. This is usefull in commit-hooks and
for the inline documentation generation system.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lexer maintains a stack of last seen comments.
On blank lines the lexer flush the comments.
On each opening brace the lexer enters a new stack level.
On each block AST nodes, the stack is popped.
Each AST nodes has a doc property that is filled with the
last seen comments on node creation (in fact only on important node
creation representing statements).
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
| |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following manifest wasn't working:
class one {
notice('class one')
}
class one {
notice('second class one')
}
include one
It all boiled down to class code not being arrays.
Encapsulating code in ASTArray when needed is enough to append code,
because of the property of ASTArray to evaluate all their members in
turn.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
| |
If the ASTArray contains children that evaluate to arrays themselves,
they aren't flattened.
|
|
|
|
| |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
|
|
|
|
| |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
| |
Up until this patch, TemplateWrapper.tags was returning all the tags
defined in the catalog. I think this is wrong and tags shoul only
return the defined tags in the current scope.
Hence, I defined a all_tags method that returns the list of tags defined
in the whole catalog.
|
| |
|
|
|
|
| |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
| |
Add to predefined variables to the ERB template space. "classes"
and "tags" which provide arrays of all the defined classes and tags
for a node.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch allows to do this:
User <| groups == leads |>
@user { "foo":
ensure => "present",
groups => ["bar","baz","leads"]
}
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changesets allow empty if or else branches:
if true {
} else {
}
It works by emitting on the parser stack an AST node that doesn't
do anything (a no-op). This allows the less intrusive code
as no part of the if evaluation code has been touched.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow this syntax:
Resource[title1,title2] { param => value }
as a compact form of
Resource[title1] { param => value }
Resource[title2] { param => value }
This patch also introduces for free the possibility to group
class references by type:
exec {
test:
require => File["file1","file2","File3"]
}
which is completely equivalent to:
exec {
test:
require => [ File["file1"],File["file2"],File["File3"] ]
}
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expressions can be used in if 'test' and in the
right side of assignements.
The expressions can contain any number of sub-expressions
combined by either arithmetic operators, comparison operators,
or boolean operators.
Random Usage Examples:
$result = ((( $two + 2) / $one) + 4 * 5.45) - (6 << 7) + (0x800 + -9)
or
if ($a < 10) and ($a + 10 != 200) {
...
}
|
|
|
|
|
| |
This changeset adds +,-,/,*,<< and >> computation and
AST parse nodes.
|
| |
|
| |
|
| |
|