| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following manifest doesn't work:
$foo = undef
case $foo {
undef: { notice("undef") }
default: { notice("defined") }
}
This is because "undef" scope variable are returned as an empty
string.
This patch introduces a behavior change:
Now, unassigned variable usage returns also undef.
This might produce some issues in existing manifests, although
care has been taken to allow correct behavior in the most commonly
used patterns.
For instance:
case $bar {
undef: { notice("undef") }
default: { notice("defined") }
}
will print "undef".
But matching undef in case/selector/if will also match "".
case $bar {
"": { notice("empty") }
default: { notice("defined") }
}
will print "empty".
Of course "" doesn't match undef :-)
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is technically a duplicate of #1531, I think this change prevents
the problem that appears in #2812, without touching the underlying issues
of #1531.
ssh_authorized_key was failing on keys in ~/.ssh/authorized_keys that
lack a comment field - it would generate a Ssh_authorized_key resource
with the name set to nil, which raises "ArgumentError: Field 'name' is
required."
Fixed by setting such keys' name fields to an empty string.
This prevents the error from being raised and the authorized_keys files
round-trip successfully.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
In post processing a Symbol was being passed to StringScanner.
StringScanner was not happy with this. The error message lost
backtrace information and the test coverage was both inadequate
and broken (see #2745).
To be fully effective, this patch needs/assumes the patch for
Signed-off-by: Markus Roberts <Markus@reality.com>
|
|
|
|
|
|
|
|
|
| |
The old fakedata test facility was not playing nicely with the
spec tests; although it looped through all the files failures
in any example file after the first were being ignored because
of the way fakedataparse was interacting with the before blocks.
Signed-off-by: Markus Roberts <Markus@reality.com>
|
|
|
|
|
|
|
|
| |
This isn't really a refactor, just moving code around.
I did some simple method renaming, also.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
| |
Also removed old conflicting file tests.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the path parameter set to false, the server defaults
to Puppet[:server]. This allows to use a remote filebucket without
syncing the servername there with the one used on the config file.
To use the default server, this manifest can be used:
filebucket { main: path => false }
A related bug report is:
http://projects.reductivelabs.com/issues/2456
|
| |
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
These tests tried to load something, verified
the loads didn't work, and then created
the thing to load. This is a bit silly,
so I just removed those sections of the tests.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
| |
This was to fix a failing test/unit test.
Test coverage is now a bit better, more maintainable,
and I refactored the code just slightly to make it a bit
cleaner.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
| |
7 was added as a valid weekday in #2293, and this
test just corrects that.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
This patch uses the unused AST::HostName as the only way to reference
a node in the AST nodes array.
The AST::HostName respect the hash properties of the underlying
string, to keep the O(1) hash properties.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The case and selector statements define ephemeral vars, like 'if'.
Usage:
case statement:
$var = "foobar"
case $var {
"foo": {
notify { "got a foo": }
}
/(.*)bar$/: {
notify{ "hey we got a $1": }
}
}
and for selector:
$val = $test ? {
/^match.*$/ => "matched",
default => "default"
}
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changeset introduces regexp in if expression with the use of the
=~ (match) and !~ (not match) operator.
Usage:
if $uname =~ /Linux|Debian/ {
...
}
Moreover this patch creates ephemeral variables ($0 to $9) in the current
scope which contains the regex captures:
if $uname =~ /(Linux|Debian)/ {
notice("this is a $1 system")
}
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the behaviour when you have file recursions
that overlap - we again correctly use the most
specific information.
It's still a bit expensive when you do this, but
at least it behaves correctly, and it should be
a rare circumstance.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
| |
This feature has been broken since who knows when,
yet no one's noticed. Thus, it's a good
candidate for removal.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have extended the concept of provider specificity so it
now includes both specified defaults and class depth, so:
* We are much more likely to choose the correct provider;
e.g., 'init' will be chosen over 'base'
* We're much less likely to print this warning, because it's
only printed when provider specificities are equal which
is much rarer
lib/puppet/provider.rb | 4 ++--
lib/puppet/type.rb | 4 ++--
spec/unit/type.rb | 17 +++++++++++++++++
test/ral/manager/type.rb | 22 ----------------------
4 files changed, 21 insertions(+), 26 deletions(-)
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
We basically just make sure that we tell Ruby
about files we've loaded, so you can 'require' these
files and doing so will essentially no-op, rather
than clobbering the already-loaded code.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
opaque strings
This patch removes the limitation of allow/deny which were
only matching ip addresses or hostname (or pattern of).
It makes sure any kind of string can be matched (by strict
equality) while still keeping the old behaviour.
Opaque strings can only contains: alphanumeric characters, -
_ and @.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
| |
I also took the opportunity to clean up and simplify
the interface to the parts of the parser that interact
with this. Mostly it was method renames.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
| |
The goal of this commit is to fix ordering issues
that could result when the filebuckets are added
to the catalog after the resources that use them.
This condition showed up somewhat arbitrarily.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
Comments and multi-line comments produces no token per-se during
lexing, so the lexer loops to find another token.
The issue was that we were not skipping whitespace after finding
such non-token.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
| |
We were previously throwing exceptions.
This also ports all of the tests for variable lookup
over to rspec.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mongrel puppet code uses REMOTE_ADDR to set the ip address which will
be use to authenticate the client access.
Since mongrel is always used in a proxy mode with Puppet, REMOTE_ADDR
is always the address of the proxy (usually 127.0.0.1), which defeats
the purpose.
With this changeset, the mongrel code now uses the X-Forwarded-For
HTTP header value if it is passed over the REMOTE_ADDR.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
There's more caching to add, but this simplifies
the interface to the list of paths and then caches
that list so we aren't constantly searching the
filesystem.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, when you created a module you had to specify
the path. Now Module instances can use the module path
to look up their paths, and there are methods for determining
whether the module is present (if the path is present).
Also cleaned up the methods for figuring out what's in
the module (plugins, etc.).
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
All the snippets tests were failing because some parser and scope
tests activated storeconfigs without reseting the state.
Activating storeconfigs is not undoable at the moment by just
setting storeconfig=false as some terminus are changed.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
| |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
| |
This patch moves Type to use Puppet::Util::Tagging as the other
part of Puppet. This brings uniformity and consistency in the
way the tags are used and/or compared to each other.
Type was storing tags in Symbol format, which produced #2207.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idea is to have allow/deny authorization directives
that are dynamic: their evaluation is deferred until
we perform the authorization checking in allowed?.
This is done to allow replacing backreferences in allow/deny
directives by parameters of the match that selected this right.
For instance, it is possible to:
allow $1.$2
And using Right::interpolate() with the result of a regex match
using 2 captures, will evaluate $1.$2 to those captures.
For instance, if we captured [host, reductivelabs.com], then the
allow directive is replaced by:
allow host.reductivelabs.com
It is then safe to call allowed?, after which we can reset the
interpolation.
This interpolation is thread-safe.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
authconfig regex support
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
| |
They don't work with the modified code, and we
rely almost entirely on manual integration testing
for this stuff anyway.
We definitely need to add tests where we can, but
these tests are totally useless.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
| |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
bin/ralsh
lib/puppet/executables/client/certhandler.rb
lib/puppet/parser/functions/versioncmp.rb
lib/puppet/parser/resource/reference.rb
lib/puppet/provider/augeas/augeas.rb
lib/puppet/provider/nameservice/directoryservice.rb
lib/puppet/provider/ssh_authorized_key/parsed.rb
lib/puppet/type.rb
lib/puppet/type/file/checksum.rb
spec/integration/defaults.rb
spec/integration/transaction/report.rb
spec/unit/executables/client/certhandler.rb
spec/unit/indirector/ssl_rsa/file.rb
spec/unit/node/catalog.rb
spec/unit/provider/augeas/augeas.rb
spec/unit/rails.rb
spec/unit/type/ssh_authorized_key.rb
spec/unit/type/tidy.rb
test/executables/filebucket.rb
test/executables/puppetbin.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These tests once again largely were caused
by /usr/sbin not being in the path and by
~ not being writable.
The only tests still failing are Rails tests,
and my guess is that they're all failing because
of the recent work by Brice. They should probably
just be removed.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When using recurse and a source, if the client side has many files
it can take a lot of CPU/memory to checksum the whole client
hierarchy. The idea is that it is not necessary to recurse on the
client side if all we want is to manage the files that are sourced
from the server.
This changeset adds the "remote" recurse value which prevents recursing
on the client side when a source is present. Since it also is necessary
to limit the remote side recursion a new File{} parameter has been
added called "recurselimit".
Moreover, the Filetset API is changing to allow the new recurselimit
parameter, and passing the recursion depth limit in the recurse parameter
as an integer is now deprecated and not supported anymore.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| | |
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
semicolons
|