| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Ensured that withenv properly restores the environment after it runs a block and added testing for the method.
Reviewed-by: Matt Robinson and Daniel Pittman
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example with the following:
test.conf:
[master]
rrddir = /var/lib/puppet/rrd
templatedir = /var/lib/puppet/templates
[env_a]
templatedir = $rrddir/templates
rrddir = /tmp/env_a/
The command:
RUBYLIB=lib bin/puppet master --config ./test.conf --environment env_a --configprint templatedir
originally produced '/var/lib/puppet/rrd/templates' instead of the
expected '/tmp/env_a/templates'
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
|
|
|
|
|
|
| |
Puppet::Util.execute with an arbitrary code block for ease in spec
testing.
Reviewed-by: Max Martin <max@puppetlabs.com>
|
|
|
|
|
|
|
|
| |
It turns out that the ability to sort symbols comes in the preinit
section of application run when we load Facter and hit the code that
adds the <=> method for symbols in lib/facter/util/plist/generator.rb
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Puppetdoc was relying on RDoc to provide the puppet entity (class, definition
node, etc...) hyperlinking in comments.
Unfortunately, RDoc was assuming namespaces are capitalized like Ruby
namespaces and that definition would use the # or . separator.
This change adds on top of RDoc puppet namespace format for classes and
definition.
This will make sure the comment hyperlinking will work as intented.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| | |
lib/puppet/util/command_line.rb had a special case for puppet --help to return generic help instead of the puppet apply help, but it would return puppet apply help when you gave it -h.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch allows us to make C-style "assertions" in Puppet code,
e.g.:
assert_that { condition }
assert_that(message) { condition }
These methods will raise an exception if the environment variable
PUPPET_ENABLE_ASSERTIONS is set to a non-empty value, and the the
condition evaluates to false. If the environment variable
PUPPET_ENABLE_ASSERTIONS is not set, then the condition is not even
checked.
Switching the assertions on with PUPPET_ENABLE_ASSERTIONS carries
three advantages:
1. It makes it possible to put potentially expensive checks in
assertions without degrading the performance of the code in production
environments.
2. It allows strict assertions to catch Puppet bugs early in
development, without increasing the risk of a crash in production
environments.
3. It allows a simple command-line mechanism to run any Puppet command
with assertions enabled.
|
|\ \
| | |
| | |
| | |
| | |
| | | |
* 2.6.x:
Updated CHANGELOG for 2.6.5rc4
(#3646) Fix the documentation fix for `puppet apply --apply`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
--apply is actually off of `puppet apply`, not off of `puppet agent` (nor
`puppet master`), so move the documentation accordingly.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
|
|\| |
| | |
| | |
| | |
| | |
| | | |
* 2.6.x:
Updated CHANGELOG for 2.6.5rc3
Updated fix for #3646 - apply / compile documentation
|
| | | |
|
|\ \ \
| |/ /
|/| |
| | | |
bug/2.6.next/5720-puppetdoc-fails-on-parameterized-class
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It can happen that when parsing a file puppet parses other manifests
if they get imported (this is at least true for site.pp, even in
ignoreimport=true). Thus those files are now "watched".
But puppetdoc needs to analyze all files, and since 99c101 we are now
checking if the file was already parsed to not reparse it again.
If that was the case, though, we weren't analyzing the produced code.
Thus it was possible to not produce documentation for the site.pp content.
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>
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| | |
- previously, Puppet would search $LOAD_PATH and just
load applications in the first $LOAD_PATH to have
the directory puppet/application. Now multiple paths
can contain applications.
|
|\ \
| | |
| | |
| | |
| | | |
* bug/2.6.next/5755-gc-issue:
Fix for #5755 -- making zaml serialization robust over projected objects
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The core problem arose when the fix for #5048 in 31118fe85aca4 introduced a
hook to replace objects dynamically durring serialization so that they could be
projected / rewritten to a different form for backward compatability. The
serialization code assumed that all objects being serialized would remain valid
until the serialization was complete, but nothing retained a copy of the
temporary objects created in the hook.
To resolve this, the serialization layer now maintains a ref to each such object
and clears them (to allow GC) after serialization is complete.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
Paired-with: Paul Berry <paul@puppetlabs.com>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We previously had an ordering dependency in the autoflush option, which was
statically read from defaults when the log destination was configured.
We add a hook in the defaults to update the log subsystem, which in turn
updates log destinations, when autoflush is changed.
This would work as desired:
puppet agent --autoflush --logdest=file
This would not work, as autoflush would be false:
puppet agent --logdest=file --autoflush
Now those changes propagate correctly.
Paired-with: matt@puppetlabs.com
|
|\ \ |
|
| |\ \ |
|
| | | | |
|
| |\ \ \ |
|
| | |/ / |
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
* jamtur01/tickets/2.6.x/5736:
Modified rubydoc in lib/puppet/util/command_line/puppetca to fix inaccurate description of --clean.
|
| | |/ /
| | | |
| | | |
| | | | |
description of --clean.
|
| |\ \ \ |
|
| | |/ /
| | | |
| | | |
| | | | |
Patch from: Nick Fagerlund
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit addresses the original issue that the change reverted in the previous
commit for #5755 was intended to fix by removing the special case on labels in
emit (lables, even if they are never generated, are not "new lines" and thus
@recent_nl should always be set to false when one is emitted).
It also partially addresses a related issue wherein temporary strings generated
when field names are constructed recycle their object_id (they are temporary)
and thus cause incorrect back references. This commit "fixes" the problem by
never generating backrefs to strings (treating them as immutable).
It does not address other suspected issues such as thread safety durring serialization
due to the use of class variables to store the seen-object hash or the use of object
ids as "permanently unique" identifiers.
Paired with: Daniel Pittman
Advice & Commiseration: Jesse Wolfe
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
* commit 'f279f2c24ad1c87940eca3592f4c6e2f5676c694':
Fixed #4968 - Updated list of options turned on by --test in documentation
|
| |/ /
| | |
| | |
| | |
| | | |
Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* issues/2.6.next/5566:
(#5566) Treat source only File checksums as syntax errors when used with content
Rename variable used in File type validation to be more clear
Remove invalid "timestamp" and "time", and add missing "ctime" File checksum types.
Remove order dependency when specifying source and checksum on File type
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Certain checksum types (ctime, mtime) only make sense when used with the
'source' File parameter, since there is no way to check them on raw
strings.
Given the limitations of the current checksumming implementations, it is
likely to introduce unexpected behavior when using the 'none' checksum
type and either one of the 'source', and 'content' File parameters.
Because of this, it is now a syntax error to use a checksum of 'none' with
either parameter.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | | |
* jamtur01/tickets/2.6.x/3646:
Fixed #3646 - Added documentation for compile and apply to man page
|
| |/ / |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This data structure generates YAML with an extra newline that violates the
syntax rules and all:
list = [1]
{ :a => list, :b => list }.to_yaml
This breaks real client use of the YAML catalogs, not to mention our own use
of cached catalogs...
|
| | |
|
| |
| |
| |
| |
| |
| | |
This attribute was only relevant in reports, and in reports it was
redundant with Puppet::Transaction::Report#configuration_version and
Puppet::Transaction::Report#puppet_version.
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| | |
The #write method in lib/puppet/type/file/content.rb relies on the block
passed to #sum_stream getting executed. "none", "mtime", and "ctime"
aren't real checksums, so they violated that assumption and just
returned empty results. This patch causes that block to get executed.
|
|/
|
|
|
|
|
|
|
|
| |
This patch makes it possible to both audit and manage an attribute.
It introduces a new field on Event objects "historical_value", which is
the value from state.yaml. The value from the RAL is written to
state.yaml, and then the RAL is updated with the desired value.
Paired-With: Nick Lewis <nick@puppetlabs.com>
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
| |
I swear I've done this before. *confused*
|
|
|
|
|
|
|
|
| |
There was a section of code that didn't take the legacy RRD library into
account. This caused a unit test failure, but only if you have the RRD
legacy library installed, which I did.
Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
This should allow to run puppetdoc on ruby 1.8.5.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
| |
RDoc has some standard parsers for .c,.cc or fortran files (don't ask why).
Unfortunately our html generator doesn't support the data structures
generated by those parsers and we were bombing on unknown methods.
This patch makes sure we generate html only for our own top level objects.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|