summaryrefslogtreecommitdiffstats
path: root/lib/puppet/property.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fixing Property#change_to_s in rare case failuresLuke Kanies2010-04-121-3/+3
| | | | | | | | | If we were removing a field, which really only 'cron' does, then we got an exception. This is fixed, and now tested. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing feature validation when passed one itemLuke Kanies2010-02-171-0/+1
| | | | | | | | When I changed how the validation errors worked I accidentally caused the feature list to need to be an array rather than supporting either. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Solidifying the RAL/Event integration.Luke Kanies2010-02-171-5/+1
| | | | | | | | | | | | | | 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-171-1/+1
| | | | | | | | 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.
* Moving event creation to the resourceLuke Kanies2010-02-171-3/+2
| | | | | | | | 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-171-23/+15
| | | | | | | | | | 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>
* Random code cleanupLuke Kanies2010-02-171-3/+3
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving Ensure property into separate fileLuke Kanies2010-02-171-92/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix for #2817 (links created even when links property set to follow)Markus Roberts2009-12-151-11/+3
| | | | | | | | | Commit 82714246b913087292f04190e03a885c99723f52 lost the distinction between links that were being followed and links that were being managed. This reinstated the distinction and (taking Luke up on his offer) also includes various cleanups. Signed-off-by: Markus Roberts <Markus@reality.com>
* Ticket #2685 (Type error in ssh_authorized_keys)Markus Roberts2009-10-231-0/+1
| | | | | | | | | | | 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 #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>
* Adding metadata delegation from param to resourceLuke Kanies2009-08-031-13/+0
| | | | | | | | | | This is for file, line, version, and tags, with the parameter name added to the tags. This is mostly so logs generated by the parameters work better. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-4/+4
|
* Add an unmunge capability to type parameters and propertiesBrice Figureau2009-05-021-2/+2
| | | | | | | | | | | | | Unmunge is the reverse of munge. While munge allows the type to return a different parameter value or properties should than the one it was created with, unmunge does the reverse. It can be used for instance to store a value in a different representation but still be able to return genuine value to the outside world. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-261-2/+2
| | | | semicolons
* Fixing all broken tests. Most of them were broken by fileserving changes.Luke Kanies2008-12-021-2/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2008-12-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/puppetca lib/puppet/type/group.rb lib/puppet/type/tidy.rb lib/puppet/util/settings.rb Also edited the following files so tests will pass: lib/puppet/type/component.rb spec/unit/ssl/certificate_request.rb spec/unit/type/computer.rb spec/unit/type/mcx.rb spec/unit/type/resources.rb spec/unit/util/settings.rb spec/unit/util/storage.rb test/ral/type/zone.rb
| * Fixing #1764 - a property's 'sync' method is never considered a no-op.Luke Kanies2008-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *This is a behaviour change.* If the property does not return an event name, then one is generated based on the property name. Previously, the 'sync' method could return nil and it would be considered a noop, but if you need a noop, then you need to modify your 'insync?' method to return 'true' in the noop cases. Also modifying all of the builtin types that didn't handle this explicitly or returned nil in 'sync'. There should be no behaviour change in any of them. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing tests broken by fileserving and other refactoring.Luke Kanies2008-11-081-3/+0
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Converting the file 'source' property to a parameter.Luke Kanies2008-11-051-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes a lot of sense because source was always more of a metaparameter than a property -- it affected the 'should' values of other properties, but it shouldn't have done any other work. It will hopefully make everything else much cleaner. This is such a large commit mostly because of the need to fix a lot of tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Switched all value management in props/params to internal classes.Luke Kanies2008-11-041-93/+64
|/ | | | | | | | | | | This is a significant refactor of some very murky code, and it's all much cleaner and more readable now. All of the 'newvalue' methods and any value-related code is in a ValueCollection class. This puts us in a good position to refactor the Property and Parameter classes more completely. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing some code in Parameter that is unnecessary.Luke Kanies2008-09-231-1/+2
| | | | | | | | | It's duplicated in Property, but was only ever called if the instance was Property -- in other words, the base class new about its subclass, but the subclass overrode that method any way. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #1595 - Internally, Property#retrieve is no longer calledLuke Kanies2008-09-231-0/+5
| | | | when no 'should' value is available for a resource.
* Renaming the Puppet::PropertyChange class to Puppet::Transaction::Change.Luke Kanies2008-07-031-1/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #920 -- I have replaced the existing mount test with anLuke Kanies2007-11-261-1/+1
| | | | | rspec version. It's not perfect, in that it only tests the :ensure state, but that's where 90% of the behaviour is.
* Rewriting the tests for the package resource type, fixing #930.Luke Kanies2007-11-261-37/+23
|
* Fixed #827. Applied a form of the patch provided by porridge andMichael V. O'Brien2007-10-041-2/+1
| | | | wrote a test.
* Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
|
* Fixing transactions so that they do not flush resources that are in noopluke2007-07-111-7/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2678 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding support in Property for declarating whether a given property type ↵luke2007-07-101-6/+37
| | | | | | will match all @should values or just the first. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2674 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing the long-obsolete Element base class. The Parameter and Type ↵luke2007-07-041-0/+528
classes no longer have the same base class. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2647 980ebf18-57e1-0310-9a29-db15c13687c0