summaryrefslogtreecommitdiffstats
path: root/lib/puppet
Commit message (Collapse)AuthorAgeFilesLines
...
| | * Use notice() in the versioncmp() docsTodd Zullinger2009-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use of notify() is an error, so replace it with notice, which is a function. Alternately, notify { msg => '2.6-1 is > than 2.4.5' } could be used. Signed-off-by: Todd Zullinger <tmz@pobox.com>
| | * Ticket #2665: Regexp exception on ++ in package namesMarkus Roberts2009-10-254-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affects several providers: dpkg, rug, up2date, urpmi Fixed by escaping the package names with Regexp.escape Patch by Jesse Wolf Signed-off-by: Markus Roberts <Markus@reality.com>
| | * Fixed #2750 - Set :cacrl to nil instead of 'false' in puppetdJohn A. Barbuto2009-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The latter is deprecated and was keeping puppetd from starting. Also added a test and fixed a typo in another test. Signed-off-by: John A. Barbuto <jbarbuto@corp.sourceforge.com>
| | * Fix #2691 - Collection AR request should not include params if querying with ↵Brice Figureau2009-10-251-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tags f9516d introduced a change in the way the user tags are persisted to the database: user tags are now treated as regular tags (they are stored to the tags table). Thus this commit changed the AR collector request to also look at the tags tables when collecting. Unfortunately this added a performance regression since tag request were still importing the resources parameters tables and AR was issuing a large request which was returning all the resource parameters joined with the tags. This commit fixes the AR request to join to the needed table, instead of doing an include. Including (ie eager loading) parameter values was not working for resource parameters anyway since at least 0.24 because searching by parameter add a constraint to the joins and only the searched parameter was returned instead of all parameter for a given exported resource. So on a performance standpoint this new code should be as fast 0.24 was. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| | * Workaround #2668 - Compress facts so that the request size limit triggers ↵Brice Figureau2009-10-252-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | less often This is not the right fix, but more a hackish workaround. Since 0.25, the facts are transmitted as GET parameters when a node asks for a catalog. Most proxies or webserver have a size limit which is sometimes reached. In this case the request is denied and the node can't get its catalog. The idea is to compress facts (some non-scientific studies show a 57% fact size decrease for an average node) when transmitting those when asking for a catalog. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| | * Fixed #2737 - The zone provider needs to get acquainted with OpenSolarisMartin Englund2009-10-241-3/+12
| | |
* | | Fix for #2959 (calling exit status on a nil report)Markus Roberts2009-12-181-1/+3
|/ / | | | | | | Signed-off-by: Markus Roberts <Markus@reality.com>
* | Fixing #2596 - Node, Class, Definition are not ASTLuke Kanies2009-12-0911-518/+294
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Adding module metadataLuke Kanies2009-12-091-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a first version that does very little - it has a few fields, and allows speciification of dependencies with other modules as well as compatibility with individual Puppet versions. It's not really sufficient, because it only allows specific versions, rather than a range of versions, but it's a good demo of what it takes and what we provide. 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-262-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fixed #2568 - Add database option 'dbconnections'Richard Soderberg2009-11-202-4/+13
| | | | | | | | This sets the ActiveRecords connection pool size, when connecting to remote databases (mysql, postgres). default is 0; the 'pool' argument is only passed to ActiveRecords when the value is 1 or greater.
* | Fixing #1507 - Adding a :ca_name settingLuke Kanies2009-11-202-1/+7
| | | | | | | | | | | | | | | | This allows one to specify the name to use in the CA certificate. It defaults to the :certname, but for those stuck using mod_ssl it can be changed. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #2617 - using the searched-for REST nameLuke Kanies2009-11-201-1/+3
| | | | | | | | | | | | | | | | | | This allows a separation between the wrapper class and its internals, which is (at least) necessary for the CA cert, which might not be found using the internal name. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Always using the CA_name constant instead of "ca"Luke Kanies2009-11-204-6/+7
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fix #1934 - detailed-exitcodes for puppetdDeepak Giridharagopal2009-11-195-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option only works when --onetime is specified, as it doesn't make much sense to worry about exit codes in the context of a long-running daemon. This required a refactoring of the existing --detailed-exitcodes code, as "puppetd" wasn't directly creating a transaction object (like "puppet" does). Added Report::exit_status, which did what was previously hard-coded into the "puppet" executable. An Agent's "run" method now returns a value (the result of the individual client class' "run" method) The "puppetd" agent's "run" method now returns a transaction report, as that seems like the logical thing to return as the result of applying a catalog. Signed-off-by: Deepak Giridharagopal <deepak@brownman.org>
* | 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-124-3/+18
| | | | | | | | | | | | | | | | | | 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>
* | type augeas: add 'incl' and 'lens' parametersDavid Lutterkort2009-10-242-3/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These parameters allow loading a file anywhere on the filesystem; using them also greatly speeds up processing the resource. * lib/puppet/type/augeas.rb: add 'incl' and 'lens' parameters; change default for 'context' when 'incl' is given. * lib/puppet/provider/augeas/augeas.rb: when 'lens' and 'incl' are given, only load that file * spec/unit/type/augeas.rb: check that constraints on new parameters are enforced This fixes ticket #2694
* | Patch to address feature #2571 to add Oracle support to PuppetAvi Miller2009-10-244-6/+15
|/ | | | | | Adapter requires specifying database, username and password. Signed-off-by: Avi Miller <avi.miller@gmail.com>
* Ticket #2685 (Type error in ssh_authorized_keys)Markus Roberts2009-10-232-12/+7
| | | | | | | | | | | 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>
* Fix for #2736, target doesn't work for ssh_authorized_keysMarkus Roberts2009-10-211-35/+1
| | | | | | | | There were a number of problems here (duplicated code, meaningless tests, etc.) but the core was that the last definition of target ignored the provided value if there was also a user specified. Signed-off-by: Markus Roberts <Markus@reality.com>
* Ticket #2734 PSON/JSON not serializing classes of a catalogMarkus Roberts2009-10-191-1/+6
| | | | | | | Now it does, there are tests to prove it, and the related tests for tags and version have been strengthend. Signed-off-by: Markus Roberts <Markus@reality.com>
* Bug #1900 Parsing of quoted $ in stdinJesse Wolfe2009-10-192-17/+26
| | | | | | | | | | | | | | | 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>
* Fixing #2735 - node classes are immed. added to classlistLuke Kanies2009-10-181-0/+3
| | | | | | | | | This commit adds any external node classes to the classlist at compiler initialization, so that at least those classes will be isolated from any ordering issues encountered when testing the contents of the class list during compilation. Signed-off-by: Luke Kanies <luke@madstop.com>
* Bundling of pure ruby json lib as "pson"Markus Roberts2009-10-1718-135/+1240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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")
* Proposed alternative solution for #2664 (REGEX / DIV lexing)Markus Roberts2009-10-161-31/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | This is my proposed attack on the lexing problem, with a few minor cleanups to simplify its integration. The strategy: * Anotate tokens with a method "acceptable?" that determines if they can be generated in a given context. Have this default to true. * Give the lexer the notion of a context; initialize it and update it as needed. The present context records the name of the last significant token generated and a start_of_line flag. * When a token is found to match, check if it is acceptable in the present context before generating it. These changes don't result any any change in behaviour but they enable: * Give the REGEX token an acceptable? rule that only permits a regular expression in specific contexts. The other changes were a fix to the scan bug Brice reported, adjusting a test and clearing up some cluttered conditions in the context collection path. Added tests and subsumed change restricting REGEX to one line.
* Fix for #2681 (duplicate resource)Markus Roberts2009-10-151-17/+17
| | | | | | | Refactor to not generate explicit resources and to not bail out if one of a set can not be ensured absend. Signed-off-by: Markus Roberts <Markus@reality.com>
* Fix #2707 config_version fails more helpfullyRein Henrichs2009-10-151-1/+4
| | | | | | Use Puppet::Util.execute to run the config_version command and reraise its potential Puppet::ExecutionFailure exception as a more useful Pupppet::ParseError
* Fixes #1719, this avoids calling the external binary *which* everytime we ↵Ohad Levy2009-10-131-11/+6
| | | | are looking for a binary
* Fixed #2702 - Set :outputdir to "doc" if not specifiedJohn A. Barbuto2009-10-101-0/+1
| | | | Signed-off-by: John A. Barbuto <jbarbuto@corp.sourceforge.com>
* This updates the portage provider in three ways:Benedikt Böhm2009-10-051-5/+15
| | | | | | * update-eix is deprecated and will be removed from stable soon * update format string form eix-0.18 * fix format string for >=eix-0.18
* Fixes #2688. Macauthorization provider now handles booleans internally ↵Nigel Kersten2009-09-301-12/+12
| | | | correctly.
* Ticket #2676 (a typo)Markus Roberts2009-09-251-2/+2
| | | | | | Signed-off-by: Markus Roberts <Markus@reality.com> Signed-off-by: Markus Roberts <Markus@reality.com>
* Fix #2672 - Make sure nodenames keep their underscores when used as classnameBrice Figureau2009-09-231-1/+1
| | | | | | | | The #2627 fix was modifying nodename in case of string nodename, but was removing '_'. Since underscores is a valid character in a class name, we now allow it. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #1538 - Fixes the yumrepo backtrace in noop mode.James Turnbull2009-09-222-3/+18
| | | | Yumrepo type will now chmod on all files when a change happens. If the content is not changed then no chmod will occur.
* Fix #2664 - Mathematic expressions mis-lexed as RegexBrice Figureau2009-09-221-1/+1
| | | | | | | | | | | | | | | | This is not the real fix. It is just an hot-fix to limit the issue. The issue is that the lexer regexes have precedences over simple '/' (divide). In the following expression: $var = 4096 / 4 $var2 = "/tmp/file" The / 4... part is mis-lexed as a regex instead of a mathematical expression. The current fix limits regex to one-line. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix for #2654 (error generating error message)Markus Roberts2009-09-221-2/+2
| | | | | | | | | | | | | | Since required_features can (and frequently does) return a single item instead of an Array, the error message needed to be more robust. The tests were not specific enough to catch the fact that an error was being raised in the generation of the error, so a more specific test was added and the required_features accessor test was beefed up a little. Signed-off-by: Markus Roberts <Markus@reality.com> Signed-off-by: Markus Roberts <Markus@reality.com>
* Fix #2642 - Runit provider reworkBrice Figureau2009-09-221-14/+4
| | | | | | | | | | | The runit provider was left broken after some work on daemontools on which runit is based, and #2640 didn't override the restart command, so daemontools once was called. This patch aims to fix this provider and bring it on par with daemontools. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix for ticket #2639 (Puppet[:user]/Puppet[:group] vs. 'service')Markus Roberts2009-09-222-3/+3
| | | | | | | | | | Internally the service user & group should only be referenced by the place-holder string 'service' which is replaced with the actual user or group as needed at the puppet/OS border. This patch corrects to places in reports where Puppet[:user] and Puupet[:group] were being used instead. Signed-off-by: Markus Roberts <Markus@reality.com>
* Fixing #2632 - 'require' works for 0.25 clientsLuke Kanies2009-09-222-8/+20
| | | | | | | | I couldn't find a way to make it compatible with earlier clients, so the docs specify that it doesn't work with them, and it helpfully fails. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing relationship metaparam backward compatibilityLuke Kanies2009-09-221-6/+25
| | | | | | | | | | We broke some cases of metaparam compatibility in 0.25. Most of it was pretty esoteric, but one thing that wasn't working was relationship metaparams specified on defined resources. This adds a compatibility method for older clients. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding version information to the catalog for compatLuke Kanies2009-09-222-0/+7
| | | | | | | We need to be able to do compatibility testing, and this allows us to do so. Signed-off-by: Luke Kanies <luke@madstop.com>