summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixing #2759 - reports now have complete change infoLuke Kanies2010-02-173-16/+8
| | | | | | | | This includes every event generated in the transaction and a Resource::Status object for each resource managed, with per-resource information in it. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* ResourceHarness now doesn't check params with no 'should'Luke Kanies2010-02-171-4/+6
| | | | | | | | | | | I hadn't been skipping parameters that didn't have a 'should' value set. This almost always resulted in the right behaviour, because most properties correctly just short-circuit to being in sync if the 'should' value is nil, but this encodes it at the harness, which is where it should be. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Changing Transaction to use the new ResourceHarnessLuke Kanies2010-02-174-186/+114
| | | | | | | | | | | | This is a much messier commit than I would like, mostly because of how 'file' works. I had to fix multiple special cases, and I had to move others. The whole system appears to now work, though, and we're ready to change reports to receive resource status instances rather than events. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing log message when changes failLuke Kanies2010-02-171-3/+1
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing some compatibility and old testsLuke Kanies2010-02-171-1/+1
| | | | | | | We all know these tests should be removed, but hey, at least these ones pass now. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Renaming some methods in Transaction::ChangeLuke Kanies2010-02-171-16/+1
| | | | | | | | | | | Renaming 'go' to 'apply', which is a much more reasonable name. Also removing the 'backward' and 'forward' methods, since they're not actually used anywhere. (Well, 'forward' was used, but it just called 'go'.) Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding Transaction::ResourceHarness classLuke Kanies2010-02-171-0/+62
| | | | | | | | | This is the interface class between Transactions and Resources. It's a relatively ugly class, but it will hopefully allow us to move most/all of the messy interface code into this one, relatively small class. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding first version of Resource::Status classLuke Kanies2010-02-171-0/+51
| | | | | | | This is the class that will be returned in reports, and they'll contain the events being created. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing File type indentationLuke Kanies2010-02-171-715/+713
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing last event collection transaction codeLuke Kanies2010-02-171-13/+18
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Solidifying the RAL/Event integration.Luke Kanies2010-02-174-8/+18
| | | | | | | | | | | | | | This has two changes: * Clarifies how we get the property and resource name (we pass the instance, the event converts to a string) * Logs at the resource's loglevel when there's no error These are related, because the event creator (resource) was passing in a string rather than an instance. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Change/Event/Property interfaceLuke Kanies2010-02-173-6/+30
| | | | | | | | This gives all logging responsibility to the event, which can now produce logs identical to those produced directly by the property. At this point, the events are entirely supersets of the logs.
* Cleaning up the Log initialization code.Luke Kanies2010-02-171-20/+24
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the RAL interface to loggingLuke Kanies2010-02-174-20/+34
| | | | | | | | | | | Previously, the Log class knew a lot about RAL objects, but now the Logging module is the only one that does. This greatly simplifies the Log class, which is good, and means that whatever complexity does need to exist is directly exposed in the Logging middleware module. Signed-off-by: Luke Kanies <luke@madstop.com>
* Using Logging module in main Puppet moduleLuke Kanies2010-02-171-18/+3
| | | | | | | We've had essentially duplicate methods in this module forever, and this just removes that duplication. Signed-off-by: Luke Kanies <luke@madstop.com>
* Correcting comments and making report timestamp internalLuke Kanies2010-02-172-9/+3
| | | | | | | | | We had some no-longer-correct comments in the Transaction class, which are now removed. This also moves the timestamp for reports into the report class, so it's created at initialization by the report, rather than by the transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* Failing in app/puppet if facts are not foundLuke Kanies2010-02-171-1/+3
| | | | | | | This is a rare case in puppet, but at least will come up when we support routes. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing file content logsLuke Kanies2010-02-171-2/+2
| | | | | | | These were logging 'unknown checksum' unless the files had a source specified. Signed-off-by: Luke Kanies <luke@madstop.com>
* removing extraneous commentLuke Kanies2010-02-171-1/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding Transaction events to Transaction reportsLuke Kanies2010-02-172-1/+12
| | | | | | | This means that every event generated during a transaction, with all of its metadata, will now be in the report. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing a redundant method in ReportLuke Kanies2010-02-172-6/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing unused code and adding a couple of testsLuke Kanies2010-02-171-9/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding tests for the 'report' log destinationLuke Kanies2010-02-172-0/+4
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Extracting event management into a separate classLuke Kanies2010-02-172-84/+106
| | | | | | | | | | Thus pulls all event-related code out of Transaction. The Transaction class currently creates a single instance of this class, so it's nowhere near a "real" event manager, but at least it has very clean integration points and will be easy to upgrade as needed. Signed-off-by: Luke Kanies <luke@madstop.com>
* Changing SimpleGraph.matching_edges to expect one eventLuke Kanies2010-02-171-14/+12
| | | | | | | It previously worked with multiple, but the only caller actually only ever passed one event. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving event creation to the resourceLuke Kanies2010-02-173-6/+12
| | | | | | | | This allows the Transaction class to reuse the event creation code when it creates noop and restart events. Signed-off-by: Luke Kanies <luke@madstop.com>
* Reorganizing Property class to match current styleLuke Kanies2010-02-171-66/+34
| | | | | | | This is mostly changing some idioms, such as using "#{}" in strings rather than "%s" %. Signed-off-by: Luke Kanies <luke@madstop.com>
* Cleaning up Event creationLuke Kanies2010-02-173-57/+65
| | | | | | | | | | The Property class is now completely responsible for creating the event, and it adds all of the metadata that a log message would normally have. This provides a cleaner definition of responsibility, and will allow further cleaning up in later commits. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding "type" instance method to enhance DemeternessLuke Kanies2010-02-171-0/+4
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Random code cleanupLuke Kanies2010-02-173-65/+50
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving Ensure property into separate fileLuke Kanies2010-02-172-92/+96
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving Parameter utility classes into separate filesLuke Kanies2010-02-173-210/+216
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Switching transactions to callback-based eventsLuke Kanies2010-02-172-216/+122
| | | | | | | | | | | | | Events are now queued as they are created, and the queues are managed through simple interfaces, rather than collecting events over time and responding to them inline. This drastically simplifies event management, and will make moving it to a separate system essentially trivial. Signed-off-by: Luke Kanies <luke@madstop.com>
* removing never-used codeLuke Kanies2010-02-171-61/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving log destination code into separate filesLuke Kanies2010-02-173-276/+281
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* fixed a couple of typosMarc Fournier2010-02-172-2/+2
|
* Handle path elements with ticks and spacesBryan Kearney2010-02-171-2/+8
|
* Renaming the old puppet executableRein Henrichs2010-02-171-1/+1
|
* Find both bin and sbin usage docs, fail gracefullyRein Henrichs2010-02-171-3/+6
|
* Initial puppet single executableRein Henrichs2010-02-171-2/+12
| | | | | | | - puppet executable delegates to available applications and provides basic usage information - Puppet::Application.applications accessor added for access by main executable - Ugly hack to make RDoc::usage work
* Renaming applications, mostly removing 'puppet'Luke Kanies2010-02-177-7/+7
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Allow adding single key to hashesBrice Figureau2010-02-174-853/+925
| | | | | | | | | | This patch allow this syntax: $hash[mykey] = 12 If the key already exist an error is raised. Hashes are essentially write only, like puppet variables. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Raise an error when appending not a hash to a hashBrice Figureau2010-02-171-0/+1
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2389 - Enhance Puppet DSL with HashesBrice Figureau2010-02-176-918/+1192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bring a new container syntax to the Puppet DSL: hashes. Hashes are defined like Ruby Hash: { key1 => val1, ... } Hash keys are strings, but hash values can be any possible right values admitted in Puppet DSL (ie function call, variables access...) Currently it is possible: 1) to assign hashes to variable $myhash = { key1 => "myval", key2 => $b } 2) to access hash members (recursively) from a variable containing a hash (works for array too): $myhash = { key => { subkey => "b" }} notice($myhash[key][subjey]] 3) to use hash member access as resource title 4) to use hash in default definition parameter or resource parameter if the type supports it (known for the moment). It is not possible to string interpolate an hash access. If it proves to be an issue it can be added or work-arounded with a string concatenation operator easily. It is not possible to use an hash as a resource title. This might be possible once we support compound resource title. Unlike the proposed syntax in the ticket it is not possible to assign individual hash member (mostly to respect write once nature of variable in puppet). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2929 - Allow checksum to be "none"Brice Figureau2010-02-175-4/+18
| | | | | | | | | | | | | | | | File checksum is "md5" by default. When managing local files (not sourced or content) it might be desirable to not checksum files, especially when managing deep hierarchies containing many files. This patch allows to write such manifests: file { "/path/to/deep/hierarchy": owner => brice, recurse => true, checksum => none } Then puppet(d) won't checksum those files, just manage their ownership. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #3186 - require function set relationship only on the last classBrice Figureau2010-02-171-1/+1
| | | | | | | | Due to the fact that resource.set_parameter is overwriting the previous set_parameters, we were losing the previous relationships we set there, either in a previous call of require or in the same call. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #3150 - require function doesn't like ::class syntaxBrice Figureau2010-02-171-0/+7
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Added time module to tagmail reportJames Turnbull2010-02-171-0/+1
|
* Fixed the return types were valid, and removed the copy paste error with the ↵Bryan Kearney2010-02-171-4/+4
| | | | exception logic
* Resolving conflicts with ???Markus Roberts2010-02-171-1/+1
| | | | This actually fixes a bug in the patch, not a conflict per se, but it was small and this was the easiest way to fix it.