| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
spec/integration/indirector/rest_spec.rb has been deleted in puppet’s
next branch because it was found that the things being tested were
already covered in spec/unit/network/http/*. Also, the tests being
deleted were so overly mocked they weren’t testing much, and firing up
webrick as part of the tests was slow and causes intermittent failures
on Hudson.
This was discussed on the dev mailing list in the really long thread "No
puppet developer patches to the puppet-dev list".
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
|
|
|
|
| |
This is based on the discussion on ticket, simplified slightly and with test
adjustment.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
| |
In my fix for #4894 (commit a097b939ab52bafb681cf7c5dcaf11717add07e6) I made
and tested the fix in one case and then copied most of it (all but a variable
initialization, Doh!) to two other locations. This caused tests that would
have failed with a socket-in-use error to fail with a different error rather
than retrying.
Also fixed the spelling of "simultaneous."
|
|
|
|
|
|
| |
We already had an internal implementation of which hiding under an assumed
name (Puppet::Util.binary); this commit calls it out of hiding and uses it
consisantly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a behavior change. Before this patch, we always used the currently
connected node's certname to compile the catalog, despite the value of
the catalog URI REST request.
With this patch we now use the URI as the compiled node name.
This is safe because the default auth.conf (and default inserted rules
when no auth.conf is present) only allow the given connected node to
compile its own catalog.
But this also allows for greater flexibility with auth.conf. For instance
it can be used by a monitoring system to check multiple nodes catalogs
with only one certificate:
path ~ ^/catalog/([^/]+)$
method find
allow $1
allow monitoring-station.domain.com
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
| |
If multiple processes are running the spec tests they may conflict trying to
listen on a port. If this happens the test waits 0.1 seconds and retries for
up to 100 times before marking the test pending due to too many conflicts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Puppet::Util.sync method was not thread safe and also leaked memory. I'm
not certain, but I believe the first is ironic and the second is merely a bug.
This patch addresses the problem by 1) refactoring so the sync objects
are never returned (and thus no one can cache a reference to one) 2) adding
reference counting 3) deleting them when they are no longer needed 4) doing
the thread safty dance.
It wasn't the first (or even second) solution considered, but it's the one
that I was able to make work in a way that I'm convinced is correct. Its
main advantage is that it puts all the tricky bits in one place.
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
The dbconnection option, if set to a positive integer, will be passed to
active record as the connection pool size (pool).
|
|
|
|
|
| |
Multiple attemps were made to contact the author of this code in order to
obtain a Contributor Licence Agreement, but we were unable to do so.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using File.open(file, "w") calls open(2) with O_CREAT|O_TRUNC which
means when the file exists it is immediately truncated.
But the file is not locked yet, so another process can either write or
read to the file, leading to file corruption.
The fix is to truncate only when the file is exclusively locked. This can
be done on some operating system with O_EXLOCK open(2) flag.
I chose the more portable option of:
* open
* flock
* truncate
* write
* close
It might also be good to flush and fsync the file after writing it,
otherwise in case of crash an incomplete file can stay on disk.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Running "/etc/rc.d/SERVICE rcvar" outputs different formats for
different versions of FreeBSD. This patch adds support for those
formats, as well as tests.
Based on patches from:
o Joost van Beurden
o Russell Jackson
Paired-With: Matt Robinson
|
|
|
|
|
|
| |
This should allow to run puppetdoc on ruby 1.8.5.
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>
|
|
|
|
|
|
|
|
|
| |
I fixed a few of these in a previous patch, but Hudson found more. I
replaced the pattern of using Time.now and then doing date math to
calculate intervals with the pattern of hard setting the intervals using
utc times for the test.
Reviewed-by: Paul Berry <paul@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out that:
zero = Time.now # Reset the current time to X:00:00
current = zero - (zero.hour * 3600) - (zero.min * 60) - zero.sec
current is actually 1am on a day where the time falls back (Nov 7th),
not midnight as the test expected.
Reviewed-by: Paul Berry <paul@puppetlabs.com>
|
|
|
|
|
|
|
| |
Standardize how we create tmpdirs by using the puppet function instead
of Dir.tmpdir.
Paired-with: Paul Berry <paul@puppetlabs.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 PSON library needlessly assumed that the data to be transmitted was well-
formed unicode. This made Latin-1 users (and anyone who needed to serialize
arbitrary binary data) sad. This patch goes some of the way to resolving the
issues, by passing through non-unicode data rather than just failing, adds
tests, and cleans up a pernicious assumption about escape characters in ruby
regular expressions not marked "n" (no-encoding).
|
|
|
|
|
| |
This is intended to be a minimal fix, with tests, to prevent chage from running
unless needed.
|
|
|
|
|
| |
This fixes the command / option issues of #4963 as suggested on the ticket; the
setting-expiry when not needed aspects are deferred to #4975.
|
|
|
|
|
| |
A newline that was part of a diagnostic was left in, and this caused problems
with the serialization of strings in "preserve newlines" mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
The spec test changes for ticket 4025 (binary plist support) failed on
non-OSX systems because of a missing stub. Added the missing stub so
that the spec tests can now run on all systems.
|
|
|
|
|
|
|
| |
This adds a new feature to user providers "manages_password_age", along
with properties password_min_age and password_max_age to the user type.
These represent password min and max age in days. The useradd and
user_role_add providers now support these new properties.
|
|
|
|
|
|
|
|
| |
The code made assumptions about report structure that weren't valid for
2.6.x. The change has been verified to work with 0.25.x and 2.6.x
report formats.
Paired with: Rein Henrichs
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Modified the launchd provider to use OSX's "plutil" command to read
plists. This allows it to handle properly lists in both XML format
and binary format.
Launchd continues to write out propertly lists in XML format. This is
not a problem because the operating system is able to understand both
formats.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
Having a root ca_name that matches the fqdn of the puppet master would
cause certificate lookup problems on some clients, resulting in failed SSL
negotiation.
Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
|
|
|
|
| |
Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
Whits are inserted into the dependency graph in the place where an empty
class is being required. Unfortunately, when such a class is involved in
a loop, the error message shows the cycle as involving Whit[Classname].
This patch changes it to say Class[Classname], which is much easier to
understand. It also fixes puppetdoc from generating documentation on the
Whit type.
|
|
|
|
|
|
|
|
|
|
| |
Calling this method caused storeconfigs not to run.
ActiveRecord::Base.allow_concurrency was deprecated in Rails 2.2. We
support activerecord 2.1 and higher, so we still need to call this
method for 2.1. I factored out the code that determines our
activerecord version to a method in util so that the code was easier to
read and test.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The global "-o" option ("--onetime") was overriding the
application-specific option "-o" because global options were being
sent to the OptionParser after application-specific options.
Modified the order in which options are sent to the OptionParser to
have the correct behavior. Also merged together the two methods that
were applying options so that the order is more explicit.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running puppet doc, if the directory containing the user's
specified manifest file overlaps with the modules directory (i.e. they
are the same directory or one contains the other), Puppet doc would
try to parse the overlapping files twice, triggering an exception
which made the documentation run fail.
Fixed the bug by adding a check to the RDoc::Parser#scan method to
prevent re-parsing of files that have already been parsed. Also added
a spec test to verify that this works.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
changed the regex so that tagmail allows . in tagname.
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes spec and unit tests indirectly related to the previous
patch-revert.
One failure was from trying to test the User Type's roles, when,
on many platforms, the roles feature wasn't supported by the default
Provider.
Other tests could fail on some platforms because they assumed that
unsupported attributes would be ignored with a warning, but the code was
crashing instead.
|
|
|
|
| |
Restored deleted lines from type.rb and reinstated unit tests
|
|
|
|
| |
The test was expecting a stub object but wasn't providing one.
|