summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fixing 2792 selinux tries to set properties on unsupported filesystesJesse Wolfe2009-11-251-1/+1
| | | | | | | | | | | | | | | | | | 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>
| * Fixed #1806 - supplementary groups are not resetJames Turnbull2009-11-201-1/+11
| | | | | | | | | | | | Patch thanks to Till Maas Signed-off-by: James Turnbull <james@lovedthanlost.net>
| * Possible workaround for #2824 (MRI GC bug)Markus Roberts2009-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Fixing #2789 puppetrun fails without --tagJesse Wolfe2009-11-191-2/+20
| | | | | | | | | | | | | | | | | | 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.
| * Fixing 904 RDoc::usage incompatible with rubygemsJesse Wolfe2009-11-191-0/+8
| | | | | | | | | | | | | | Monkey-patch workaround for RDoc so it doesn't get confused by rubygems stub executables. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Least kludgy patch for #2675Markus Roberts2009-11-141-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fixing 2806 Specifying multiple tags fails to apply any of themJesse Wolfe2009-11-131-2/+2
| | | | | | | | | | | | | | | | | | 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>
| * Fix #2784 - puppetdoc/rdoc didn't parse mono-instruction class contentBrice Figureau2009-11-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fix #2796 - Fix puppetdoc rdoc selector parsingBrice Figureau2009-11-121-3/+6
| | | | | | | | | | | | | | | | | | 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>
| * Fix #2795 - puppetdoc rdoc reports a better error messageBrice Figureau2009-11-121-13/+23
| | | | | | | | | | | | | | | | | | | | 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>
| * Bug #1742 Invalid params to --color outputs 'nil'Jesse Wolfe2009-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Fixing #2596 - Node, Class, Definition are not ASTLuke Kanies2009-12-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Adding a context method to the Errors moduleLuke Kanies2009-12-091-0/+12
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Extracting language doc support into a moduleLuke Kanies2009-12-091-0/+29
| | | | | | | | | | | | | | This is so that you can still use docs without AST being the parent class. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fix 2841 - Puppetdoc/RDoc parses realize functionBrice Figureau2009-12-024-18/+66
| | | | | | | | | | | | | | | | 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>
* | Feature 2827 Option to disable managing internal filesJesse Wolfe2009-11-261-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix #2649 Allow ssl dir creation in --noop modeRein Henrichs2009-11-191-1/+9
| | | | | | | | | | | | | | | | 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.
* | Fix #2796 - Fix puppetdoc rdoc selector parsingBrice Figureau2009-11-121-3/+6
| | | | | | | | | | | | | | | | | | 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>
* | Fix #2795 - puppetdoc rdoc reports a better error messageBrice Figureau2009-11-121-13/+23
| | | | | | | | | | | | | | | | | | | | 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>
* | Fix #2784 - puppetdoc/rdoc didn't parse mono-instruction class contentBrice Figureau2009-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Covers the RDoc Puppet Parser with specsBrice Figureau2009-10-241-5/+5
| | | | | | | | | | | | | | | | 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>
* | Fix #2376 - Display class/node inheritance in puppetdocBrice Figureau2009-10-243-1/+42
| | | | | | | | | | | | | | | | | | | | 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>
* | Fix #2703 - add 'require' to puppetdocBrice Figureau2009-10-244-22/+66
|/ | | | | | | 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>
* Bug #1900 Parsing of quoted $ in stdinJesse Wolfe2009-10-191-16/+25
| | | | | | | | | | | | | | | 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>
* Bundling of pure ruby json lib as "pson"Markus Roberts2009-10-172-49/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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")
* Fixes #1538 - Fixes the yumrepo backtrace in noop mode.James Turnbull2009-09-221-0/+8
| | | | Yumrepo type will now chmod on all files when a change happens. If the content is not changed then no chmod will occur.
* Ticket #2626 (unhelpfull error messages)Markus Roberts2009-09-221-2/+4
| | | | | | | | | | 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>
* Fix #2652 - Fix SELinux syntax errorJames Turnbull2009-09-181-3/+2
|
* Fix #2622 - Puppetdoc in single manifest to console is brokenBrice Figureau2009-09-161-3/+5
| | | | | | | | | 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>
* Fix for #2605 by falling back to alternative solution to #1963Markus Roberts2009-09-151-6/+13
| | | | | | | | | | 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>
* Monkey patch to improve yaml compatibility between ruby versionsMarkus Roberts2009-09-051-0/+43
| | | | | | | | | 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>
* Fixing #2590 - modulepath is not cached inappropriatelyLuke Kanies2009-09-031-0/+8
| | | | | | | | | | | | | | | | 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>
* Fixed Naginator linkJames Turnbull2009-09-031-1/+1
|
* Fixing #2577 - clarifying and demoting the deprecation noticeLuke Kanies2009-09-011-9/+17
| | | | | | | 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>
* Fixing #2574 - autoloading finds plugins in modulesLuke Kanies2009-09-011-4/+5
| | | | | | | | 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>
* Not using the service user in settings when it's unavailableLuke Kanies2009-08-242-1/+15
| | | | | | | | | 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>
* Switching the owner/group settings to use symbolic valuesLuke Kanies2009-08-241-10/+23
| | | | | | | | | | | | | | 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>
* Moving Setting classes into separate filesLuke Kanies2009-08-244-277/+284
| | | | | | | | 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>
* Fixing #2541 - file cache is more resilient to failureLuke Kanies2009-08-101-8/+12
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Logs now assume resource params have metadataLuke Kanies2009-08-031-1/+1
| | | | | | | | | | | 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>
* Adding many tests for #2371, and slightly refactoringLuke Kanies2009-08-031-19/+19
| | | | | | | | 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>
* Fixes for Redmine 2371.Steven Jenkins2009-08-031-0/+86
| | | | | | | | | | | 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.
* Fixes #2483 - Log only copies metadata from RAL objectsLuke Kanies2009-08-041-9/+14
| | | | | | | | | | | | | | | | | | | 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>
* Fixing problems my Feature refactor causedLuke Kanies2009-08-021-3/+4
| | | | | | | | | 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>
* Migrating Feature tests to specLuke Kanies2009-08-021-15/+21
| | | | | | | | | | 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>
* Configuration version information is now in logsLuke Kanies2009-08-011-1/+6
| | | | | | | | | | 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>
* Fix #2459 - puppetdoc added namespace classes as RDoc modules instead of classesBrice Figureau2009-07-302-1/+9
| | | | | | | | | | | | | 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>
* Fix #2454 - Definition named after a module don't show in puppetdocBrice Figureau2009-07-281-2/+0
| | | | | | | | 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>
* Fix #2453 - puppetdoc mixes long class names that look alikeBrice Figureau2009-07-281-2/+14
| | | | | | | | | | 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>
* Fix #2422 & #2433 - make sure puppetdoc transform AST::Leaf boolean correctlyBrice Figureau2009-07-251-24/+5
| | | | | | | | | | 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>