| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Check that a specific file supports selinux properties before trying to
set them.
This patch is functionally identical to the one Darrell Fuhriman
submitted with the bug report.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| | |
Patch thanks to Till Maas
Signed-off-by: James Turnbull <james@lovedthanlost.net>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a moderately ugly workaround for the MRI garbage collection
bug (see the ticket for details).
I explored several other potential solutions (notably, monkey
patching the routines that trigger the bug) but none of them were
satisfactory. Monkey patching sub, gsub, sub!, gsub!, etc., for
example, either changes the scoping of $~, $1, etc. in a way that
could potentially subtly change the meaning of programs or (if you
are clever) faithfully reproduces the behaviour of MRI--including
the memory leak.
I decided to go with the standardized and somewhat obnoxious never-
used optional argument as it was easy to automatically insert and
should be even easier to automatically find and remove if a better
fix is developed. It also should be obtrusive enough to escape
accidental removal in refactoring.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Puppet::Transaction was handling "tags" strings differently depending on
whether they came in from Puppet[:tags] or another source.
This was causing puppetrun's tags to be misparsed if there was not
exactly one --tag parameter.
I've moved the code to Util::Tagging.
|
| |
| |
| |
| |
| |
| |
| | |
Monkey-patch workaround for RDoc so it doesn't get confused by rubygems
stub executables.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes parameters responsible for the canonicalization of their values and
provides a default (passthrough) implementation. It changes munge to pre-
canonicalize the value and resource references to builtin types to canonicalize
titles (which map to resorce namevars) with the corresponding parameter's
classes's canonicalization.
It adds a canonicalization routine to file paths that normalizes the behaviour
(trailing slashes are ignored) and DRYs up the related code.
Signed-off-by: Markus Roberts <Markus@reality.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix code that was passing an Array of code to a method that was
expecting a single tag.
Includes Markus's suggestions
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
class klass {
include a, b, c
}
wasn't producing any rdoc documentation.
We were thinking code was always embedded in an array which is not
the case for mono-instruction code.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch fix this bug by adding more to_s methods to ast member
so that puppetdoc can just to_s the AST to reconstruct the original
puppet code.
Of course this is not perfect, but should work most of the time.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When puppetdoc rdoc dies with an unhandled exception, the error
message produced didn't mention the file and line where the parser
choked.
This patch fixes this by trying to locate on which AST structure
the rdoc system failed.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patches fixes a bug where setting an invalid option for "--color"
caused the word "nil" to be printed on every line of the log, instead
of printing out log messages.
Invalid color options now just produce uncolored output.
It seems to me that this isn't important enough to issue a warning
about an invalid setting.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit extracts these three classes into a single
ResourceType class in the Parser heirarchy, now completely
independent of the AST heirarchy.
Most of the other changes are just changing the interface
to the new class, which is greatly simplified over the previous
classes.
This opens up the possibility of drastically simplifying a lot
of this other code, too -- in particular, replacing the reference
to the parser with a reference to the (soon to be renamed)
LoadedCode class.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| | |
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| | |
This is so that you can still use docs without AST
being the parent class.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Puppetdoc wasn't parsing the realize function.
This patch let puppetdoc find realize and display in RDoc html
mode the list of realized resource per class or node.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a flag "manage_internal_file_permissions" which is enabled by
default. Disabling this flag prevents Puppet from managing the owner,
group, or mode of files created from Puppet::Util::Settings::FileSetting
I think this is a wide enough net to follow Luke's suggestion of
"disable management of everything", and it certainly satisfies the
requests I'm aware of, but if I've missed anything, let me know.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Wrap Puppet::Settings.use in a block that disables noop mode during the
execution of the block and ensures that noop returns to its original
value afterwards. This allows internal puppet catalog operations like
ssl directory creation to occur even when puppet is run in --noop mode.
This should actually solve a broader class of related bugs.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch fix this bug by adding more to_s methods to ast member
so that puppetdoc can just to_s the AST to reconstruct the original
puppet code.
Of course this is not perfect, but should work most of the time.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When puppetdoc rdoc dies with an unhandled exception, the error
message produced didn't mention the file and line where the parser
choked.
This patch fixes this by trying to locate on which AST structure
the rdoc system failed.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
class klass {
include a, b, c
}
wasn't producing any rdoc documentation.
We were thinking code was always embedded in an array which is not
the case for mono-instruction code.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This doesn't cover all the code, only the part that interacts with
Puppet internals which is what matters when Puppet changes.
This patch also contains an integration test.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While we were keeping track of superclass/nodes during RDoc generation
we weren't doing the reverse.
This patch enhance Puppetdoc RDoc mode by tracking inheritance and
for each base/super class/nodes displays the list of inherited classes
/nodes.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|/
|
|
|
|
|
| |
Puppetdoc wasn't parsing 'require'. This patch adds a 'require' section
to list all required class from nodes and classes.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When code comes in via STDIN or --code ,
Puppet::Util::Settings interpolates $values in the code,
which is probably never the intended behavior.
This is the least destructive fix I could think of:
have Puppet::Parser::Interpreter ask for the uninterpolated value.
More general fixes could be to:
a) Add an escape character to Settings's interpolator, and escape STDIN
b) Add a mechanism to Settings to mark some values as uninterpolated
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bundeling and renaming the pure ruby json library to addresses a
number of cross version serliaization bugs (#2615, et al).
This patch adds a subset of the files from the json_pure gem to
lib/puppet/external/pson (renamed to avoid conflicts with rails) so
that we will always have a known-good erialization format available.
The pure ruby json gem as distibuted defers to the compiled version
if it is installed. This is problematic in some circumstances so the
files that have been brought over have been modified to always and
only use the bundled version.
It's a large patch, so here's a breakdown of the change categories:
The majority of the lines are only marginally interesting:
* The json lib itself (in lib/puppet/external/pson) make up the bulk
of the lines.
* Renaming of json to pson make up the second largest group.
Somewhat more interesting are the following, which can be located by
searching the diffs for the indicated strings:
* Adjusting tests to reflect the changes
* Changing the encoding/decoding behavior so that nested structures
(e.g. resources) don't serialize as escaped strings. This should
make it much easier to process the results with external tools, if
needed. Search for "to_pson" and "to_pson_data_hash"
* Cleaning up the envelope/metadata
* Now provides a document_type (as opposed to a ruby class name) by
using a symple registration scheme instead of constant lookup
(search for "document_type")
* Added an api_version (search for "api_version")
* Added a hash for document metadata (search for "metadata")
* Removing the yaml monkeypatch and instead disabling yaml serialization
on ruby 1.8.1 in favor of pson (search for "yaml")
* Cleaning up the json/rails feature interaction (they're now totally
independent) (search for "feature")
|
|
|
|
| |
Yumrepo type will now chmod on all files when a change happens. If the content is not changed then no chmod will occur.
|
|
|
|
|
|
|
|
|
|
| |
Reworks the error message to 1) make it clearer that it's an internal
error, not something the user did, 2) rearrange the sentence to make
it clearer that "setting" is being used as a noun 3) combined several
fields to increase the chance that the identifying information would
suffice to lead someone to the actual source of the error.
Signed-off-by: Markus Roberts <Markus@reality.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
After the LoadedCode refactoring I forgot to update this (mostly)
unused part of puppetdoc which unfortunately is not covered
by unit tests.
This commit fixes this issue.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
| |
Two solutions were proposed and tested for #1963; both worked but one
(the read_nonblock solution) was used for performance reasons. This
solution does not work on older ruby implementations (1.8.1) because
read_nonblock is not available. This patch implements the alternative
fix (IO.popen) as a fallback to handles such cases.
Signed-off-by: Markus Roberts <Markus@reality.com>
|
|
|
|
|
|
|
|
|
| |
Ruby 1.8.1 can not parse the yanl produced by later versions because
it requires explict type tagging of symbols. This patch adds the
tagging on to later versions so that mixed version instalations can
use yaml.
Signed-off-by: Markus Roberts <Markus@reality.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was getting cached by Environment instances too early, thus causing some
executables to use the default even when it was overridden.
We're taking the slightly extreme step of clearing the environment
list if any parameter is set, but this is relatively inexpensive and
is the only way to always be correct.
The reason that the environments cache this value at all is that to build
up their module path they have to search through every known module for a lib
or plugins directory, which is then done every time a class is sought in
the language. Caching it saves a *ton* of file accesses.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
| |
|
|
|
|
|
|
|
| |
It's now just notice instead of a warning, and it clarifies
that 0.24 clients can't be present.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
| |
We had some stupid errors that were preventing this
from happening; this fixes them and adds an
integration test.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
This gets us most of the way toward fixing #2460 - we can
now have the certificate information owned by the service
user when it's available, thus making it so that puppetmasterd
(not running as root) can read it.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We previously allowed the owner and group to be set to
arbitrary values but we never actually used it -- we always
just set them to '$user' or '$group'. This commit changes
the model to allow 'root' or 'service', where 'service'
is converted to the actual service user/group.
This has the potential to have backward compatibility concerns,
because users could have changed the owner/group in puppet.conf,
but the chances of that are fantastically small.
Signed-off-by: Luke Kanies <luke@madstop.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>
|
|
|
|
|
|
|
|
|
|
|
| |
We were previously not assuming they had it,
because I figured there were just a couple that didn't.
On closer inspection, none of them did.
The previous commit fixed that, so this commit
fixes the assumption.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
| |
This mostly focuses on adding all of the detailed tests
for this new code, but it also cleans the code up
just a little bit.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the condition checking of handlebucket, as well as
moves it (and remove_backup) into a separate module. It
additionally refactors common code out of handlebucket into
separate private methods.
Some new RSpec tests which use mock and stubs are added as well,
including removing the old test/ral/type/filebucket.rb tests
since they are already covered by RSpec tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were previously trying to figure out what data
was available based on what methods existed, but
that caught a different method profile from
modules.
This fixes it so we only look for this data from
Puppet::Type or Puppet::Parameter instances.
I had to add the ability to skip data that's
not available, since File's 'ensure' parameter
doesn't have 'file' data, I assume because of
the metaprogramming we do around the 'file' value
for 'ensure'. It's a workaround for now, and there's
a test in there to verify it, anyway.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
| |
The problems were that I wasn't propagating return
values sufficiently, such that false values didn't
travel enough, and the 'name' attribute was necessary
in the private method but wasn't actually passed in.
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>
|
|
|
|
|
|
|
|
|
|
| |
The log instances have file, line, and config version
information, although it's not currently printed.
It's available in the reports, and you can strip it
out with your own processors.
Signed-off-by: Luke Kanies <luke@madstop.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Puppetdoc while parsing a class name creates intermediate RDoc classes
to form a hierarchy. Due to a coding error, those intermediate classes
were created as RDoc modules.
Later, when puppetdoc was parsing the definition of one of this class,
it wasn't finding it in RDoc list of classes (since it was recorded
as a module).
Puppetdoc was then creating documentation for two objects of the same
name.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
| |
RDoc#find_local_symbol can return a module. So if you have a defition
of the same name as the module in which it is defined we weren't
producing documentation for it.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
| |
The issue is that RDoc (the engine producing the documentation) is
buggy:
With a class named: A::C
and a class named: D::A::E
Then RDoc was attaching E under the root ::A and not D::A.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|
|
|
|
|
|
|
|
|
|
| |
AST nodes don't have a valid to_s that is producing a correct
representation of said node.
This patch adds some of the AST node to_s to produce correct
values that can be used verbatim by puppetdoc to render
the documentation.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
|