summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Documentation fixesJames Turnbull2010-06-241-8/+8
|
* Bug 3731. Applied Fix suggested by Doug Warner to always flatten out the arrayBryan Kearney2010-06-241-0/+1
|
* [#3810] Do not create a reports settings blockRein Henrichs2010-06-241-4/+2
| | | | | Puts reportdir and reporturl back in the "main" block because this makes tests break for reasons I don't understand.
* Tweak for fix for #1175 to fix test failuresMarkus Roberts2010-06-241-1/+1
| | | | | | Tests that weren't managing the environment but were still expecting to have functions defined in it were appalled when the functions/environments binding actually started working. This patch fixes those tests.
* [#2646] Fixes the change to onetime made in b96cd6cNick Lewis2010-06-241-1/+3
| | | | | | This change allows the --onetime command line option to be set by the Puppet[:onetime] global option or read from the config file, rather than forcing it to be read from the config file.
* [#3139] Make newattr idempotentJesse Wolfe2010-06-242-14/+6
| | | | | audit's munge was not idempotent because newattr was not idempotent. This patch simplifies newattr such that it becomes idempotent.
* Fix #3932 - Add --charset to puppetdoc for RDoc modeBrice Figureau2010-02-172-2/+4
| | | | | | | This adds the --charset option to puppetdoc for RDoc mode. This allows to set the charset for the generated html. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #3907 - Hash couldn't be initialized with an empty hashBrice Figureau2010-02-171-0/+5
| | | | | | | | | | The following manifest was failing: $data = {} This patch makes sure we initalize our ast hash with an empty ruby hash when it is created without any values. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #3871 - Add the 'in' operatorBrice Figureau2010-02-175-1014/+1066
| | | | | | | | | | | | | | | | | | | | | | | This operator allows to find if the left operand is in the right one. The left operand must be resort to a string, but the right operand can be: * a string * an array * a hash (the search is done on the keys) This syntax can be used in any place where an expression is supported. Syntax: $eatme = 'eat' if $eatme in ['ate', 'eat'] { ... } $value = 'beat generation' if 'eat' in $value { notice("on the road") } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* [#3865] External subcommandsJesse Wolfe2010-02-171-1/+14
| | | | | This patch allows the puppet single-executable to invoke external, hyphenated subcommands, much like how git does.
* [#3802] Replace rug with zypperMatt Robinson2010-02-171-4/+4
| | | | | | OpenSuSE replaced rug with zypper so our code should too Signed-off-by: Matt Robinson <matt@puppetlabs.com>
* [#3766] Remove YAML fixupsJesse Wolfe2010-02-171-34/+7
| | | | | Remove workarounds that were only needed because ruby's builtin YAML lib is broken.
* Provides #3723. Add ability for execs to have several attempts at a successfulNigel Kersten2010-02-171-4/+58
| | | | | | | | | execution and fix minor bug with logoutput and returns as an array.. * Add 'tries' and 'try_sleep' parameters * Fix bug where returns is specified as an array and logoutput on * failure. * unit tests for both cases above.
* [#3674] Make sure that failing to load a feature isn't fatalJesse Wolfe2010-02-171-1/+1
|
* [#3674] Part 2: Autoloader load method should propagate failuresJesse Wolfe2010-02-172-19/+2
| | | | | | | | | Change Autoloader's load to re-raise exceptions that happen when trying to load files, rather than just warning. This version still does not raise an error if the file is not found, as doing so would change the behavior of 'load' pretty significantly, but I am ambivalent this.
* [#3674] Autoloader should propagate failuresJesse Wolfe2010-02-171-1/+1
| | | | | | | Change Autoloader's loadall to re-raise exceptions that happen when trying to load files, rather than just warning. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fix #3667 - Fix class namespaceBrice Figureau2010-02-171-1/+5
| | | | | | | | Class namespace is different than namespace of nodes and definition as it contains the whole qualified name. This bit was left out in the type are not AST anymore refactoring. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Removing obsolete nodescope conceptLuke Kanies2010-02-171-16/+1
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #3651 failing to pop comment stack for some constructsMarkus Roberts2010-02-172-121/+125
| | | | | Puppetdoc got confused because it wasn't popping the comment context for collections and resource defaults. This commit adds the popping.
* Fixing #3072 - Resource generation is recursiveLuke Kanies2010-02-171-0/+3
| | | | | | | | | | | | This allows you to create builtin nested resource types that generate other resources that generate other resources ad naseum. The primary point of this feature is that you can make builtin resource types that have a lot of the same encapsulation abilities of defined resource types. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixes #2646. Move onetime option from the agent to global defaults so we can ↵Nigel Kersten2010-02-172-6/+8
| | | | | | specify it in the config file.
* [#2522] authorized keys owner is verifiedMatt Robinson2010-02-171-21/+8
| | | | | | | | | | | | | The user method on the provider always returned what the resource should be, not what it actually was, so it always seemed to be insync to puppet. Also cleaned up some cruft on the perms that did different things depending on whether a user was specified on the resource. This isn't necessary since a user is required on the resource. Paired with: Jesse Wolfe Signed-off-by: Matt Robinson <matt@puppetlabs.com>
* Fixing #2337 - Adding 'freeze_main' settingLuke Kanies2010-02-172-1/+5
| | | | | | | | This disables adding any code to 'main' except in site.pp, so if you have code outside of a node, class, or define it will throw an exception. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #1545 - Adding 'caller_module_name' variableLuke Kanies2010-02-172-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | This will produce the name of the module that a given resource is defined in, rather than the module that the resource type itself is defined in. For instance: # in one/manifests/onedef.pp define one::onedef { notice "Called $name from $caller_module_name" } # in two/manifests/init.pp class two { one::onedef { yay: } } produces: Called yay from two This could obviously be extended to actually build a caller stack, as frightening as that seems. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #1545 - module_name is now a variableLuke Kanies2010-02-173-5/+10
| | | | | | | | | | | | | This is only true for resource types (e.g., classes and defines) of course. The actual variable is 'module_name': class mymod { notify { "in mymod '$module_name'": } } Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* [#4055] Confine CouchDB-related specs to the couchdb featureRein Henrichs2010-02-171-0/+2
| | | | | Prevents unmet dependency problems when running tests without the couchrest gem
* [#4055] Refactor of abstract Couch terminus, more specsRein Henrichs2010-02-171-18/+24
| | | | | * Cleaner implementation of abstract Couch terminus * More thoroughly tested facts Couch terminus
* [#4055] Add CouchDB terminus for factsRein Henrichs2010-02-175-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | Implements an abstract CouchDB terminus and a concrete CouchDB terminus used to store node facts. Node facts are stored in a "node" document as the "facts" attribute. This node document may also be used by other couchdb termini that store node-related information. It is recommended to use a separate document (or documents) to store large data structures like catalogs, linking them to their related node document using embedded ids. This implementation depends on the "couchrest" gem. * Add Puppet.features.couchdb? * Add Puppet[:couchdb_url] setting * Add Puppet::Node::Facts#== for testing * Add PuppetSpec::FIXTURE_DIR for easy access to fixture files * Add CouchDB Terminus * Add Facts::CouchDB terminus * Stores facts inside a "node" document * Use key (hostname) as _id for node document * #find returns nil if document cannot be found * #save finds and updates existing document OR creates new doc [1] * Store facts in "facts" attribute of node document
* [#3921] Fix typo "fact_terminus" -> "facts_terminus"Rein Henrichs2010-02-173-3/+3
| | | | Doh.
* Targeted fix for #3851Markus Roberts2010-02-171-1/+1
| | | | | | Older / user written providers may just return a bare string from their ___cmd functions instead of an array. This forces the command as used to be an array without breaking the cases where they (correctly) do return an array.
* [#3810] Add http reports processor and `reporturl` settingRein Henrichs2010-02-172-7/+33
| | | | | | | | | | | | Example puppet.conf: [puppetmasterd] reports = store, http reporturl = http://localhost:3000/reports * Group reporturl and reportdir in new reports section of Puppet::Settings * Add specs for both
* Fixes #3514 - CR/LF line ending in puppet.conf cause silent failureJames Turnbull2010-02-171-2/+2
| | | | Patch thanks to Alan Barrett
* [#3409] fix test failures from ldap environment patchJesse Wolfe2010-02-171-1/+1
|
* [#3409] environment is not checked when nodes are in ldapJesse Wolfe2010-02-171-11/+51
| | | | This is the patch as submitted by vichharaks ros <vichharaks.ros@hp.com>
* Fixes #3395 - CR+LF line endings in manifests cause syntax errorJames Turnbull2010-02-171-1/+1
| | | | Thanks to Alan Barrett for the patch
* [#3388] Setting host_aliases from [] to [] no longer results in any changesNick Lewis2010-02-171-3/+5
| | | | | | | The message was "host_aliases changed from 'absent' to ''". When reading from the hosts file, a host without aliases was considered to have "absent" host_aliases. The host_aliases list is now considered to be present but empty if it is absent.
* Fixing #3139 - all properties can now be auditedLuke Kanies2010-02-174-45/+86
| | | | | | | | | | | | | | | This provides a full audit trail for any parameter on any resource Puppet can manage. Just use: file { "/my/file": audit => [content, owner] } And Puppet will generate an event any time either of those properties change. This commit also deprecates the 'check' parameter in favor of a new 'audit' parameter. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - Removing Property#checkableLuke Kanies2010-02-171-16/+0
| | | | | | | | | | | It was called in the 'check' attribute but not set anywhere else. The whole point of being a property is that you can retrieve the current state of that property - not being checkable/auditable is nonsensical. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - Catalogs default to host_configLuke Kanies2010-02-173-4/+3
| | | | | | | | | | | The whole host_config concept is a bit outdated now that Configurer exists, I think, (since any catalog it uses should be a host_config). However, fixing that is outside of the scope of this series. In the meantime, this does a better job of making sure every catalog except the Settings catalogs are host_configs. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - ResourceHarness does cachingLuke Kanies2010-02-173-17/+15
| | | | | | | | | | | | | | | | | | This is again about moving transactional behaviour out of Puppet::Type and into the transactional code. I initially moved this code into Resource::Status, but it seemed to make more sense in the Harness - the Status object should be thin and have no code that doesn't make sense on both sides of the pipe, it seemed. The interface gets a bit uglier as a result, but this is all about good design != good OO (because we're increasing the argument count of methods by moving them outside of the target class). Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - removing obsolete checking in StorageLuke Kanies2010-02-171-10/+2
| | | | | | | | | We were type-checking the use of Storage for no good reason. I've removed all of that, so we can use either resources or their Refs for caching. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - scheduling moved to resource harnessLuke Kanies2010-02-173-49/+26
| | | | | | | | | | We previously had the schedule checking code in Puppet::Type, but it's more of a transactional function, and in order to do proper auditing in the transactional area, we need the cache checking done there. Scheduling is one of the few functions that actually uses cached data currently. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Improving fix for #1175; tightening thread safetyMarkus Roberts2010-02-173-10/+14
| | | | | | | | The previous code maintained thread safety up to work-duplication (so that a collision would, at worse, result in effective cache flushing and cause some additional work to be done). The preceding patch addressed the single thread issue of environment specific functions; this patch brings the thread safety up to the previous standard.
* Part 2 of fix for #1175 (functions in environments)Markus Roberts2010-02-177-43/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jesse and I are shooting for the minimal viable fix here, with the idea that a great deal of refactoring is needed but isn't appropriate at this time. The changes in this commit are: * Index the function-holding modules by environment * We need to know the "current environment" when we're defining a function so we can attach it to the proper module, and this information isn't dynamically available when user-defined functions are being created (we're being called by user written code that doesn't "know" about environments) so we cheat and stash the value in Puppet::Node::Environment * since we must do this anyway, it turns out to be cleaner & safer to do the same when we are evaluating a functon. This is the main change from the prior version of this patch. * Add a special *root* environment for the built in functions, and extend all scopes with it. * Index the function characteristics (name, type, docstring, etc.) by environment * Make the autoloader environment aware, so that it uses the modulepath for the specified environment rather than the default * Turn off caching of the modulepath since it potentially changes for each node * Tweak tests that weren't environment aware
* [#1621] Composite keys for resourcesJesse Wolfe2010-06-219-184/+116
| | | | | | | | | | | | | | | | This patch implements the fundamental pieces of the move to composite keys: * Instead of having a single namevar, we have a non-empty collection of them, and two resources are the same if and only if all of them match. Note that the present situation is a special case of this, where the collection always has exactly one member. * As currently, namevar is determined by the type. * Instead just of inferring the single namevar from the title we let types decompose the title into values for several (perhaps all) of the namevar components; note that the present situation is again a special case of this. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Use the 'root' feature rather than directly checking the uidMarkus Roberts2010-02-173-3/+3
| | | | Jesse fixed all these but David and others moved them and introduced some more so...
* variable name error in refactorJesse Wolfe2010-02-171-1/+1
|
* Remove over-eager error branch in a complicated IfJesse Wolfe2010-02-171-4/+0
|
* Confine out a lib that puppet was failing to load on non-win32Jesse Wolfe2010-02-171-1/+1
|
* Resolving conflicts with jes5199:ticket/master/2935-settings-modeMarkus Roberts2010-02-171-2/+8
| | | | | | Jesse moved the code David was patching; the conflict resolution omits David's change (since the code isn't there to be changed) and this moves the change to the new location.