summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parameter.rb
Commit message (Collapse)AuthorAgeFilesLines
* Least kludgy patch for #2675Markus Roberts2009-11-141-1/+17
| | | | | | | | | | | | | 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>
* Adding metadata delegation from param to resourceLuke Kanies2009-08-031-0/+19
| | | | | | | | | | 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-3/+3
|
* Add an unmunge capability to type parameters and propertiesBrice Figureau2009-05-021-1/+15
| | | | | | | | | | | | | 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>
* Setting resource defaults immediately.Luke Kanies2008-12-181-1/+1
| | | | | | | This makes it easier for later parameters to depend on the values of earlier parameters. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding caching support to parameters, and using cached attributes for file ↵Luke Kanies2008-11-111-0/+6
| | | | | | | | | source and metadata. As hoped, this drastically simplifies the code around retaining this data. Signed-off-by: Luke Kanies <luke@madstop.com>
* Converting the file 'source' property to a parameter.Luke Kanies2008-11-051-9/+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-211/+253
| | | | | | | | | | | 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>
* Fixing #1667 - regex automatic value documentation is now readable.Luke Kanies2008-10-291-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing some code in Parameter that is unnecessary.Luke Kanies2008-09-231-5/+0
| | | | | | | | | 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-23/+1
| | | | when no 'should' value is available for a resource.
* Rewriting the tests for the package resource type, fixing #930.Luke Kanies2007-11-261-27/+32
|
* Fixing #886 -- the problem was the I had changed the baseLuke Kanies2007-11-231-0/+2
| | | | | class for Parameter, which apparently lost the 'nodoc' method for that class.
* Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
|
* Removing the long-obsolete Element base class. The Parameter and Type ↵luke2007-07-041-3/+10
| | | | | | classes no longer have the same base class. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2647 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing the to_trans method and ralsh a bit so ralsh now works with the new ↵luke2007-05-101-1/+1
| | | | | | lack of "is" method git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2503 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #605 -- providers now refer to @resource or @resource_type.luke2007-05-091-5/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2501 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #607 -- parameters and properties now refer to a @resource rather ↵luke2007-05-091-23/+33
| | | | | | than a @parent. The @parent parameter is still set for now, for backward compatibility. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2500 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the ability to manage passwords with the useradd providerluke2007-04-251-0/+4
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2414 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the ability for parameters to declare that they require a given ↵luke2007-04-251-1/+5
| | | | | | feature, and resources will not instantiate that parameter if required features are missing. This is mostly useful for properties. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2413 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #432 - you can now manage home dirs with users. You cannot yet purge ↵luke2007-03-191-0/+6
| | | | | | home directories, because there is still controversy over how that should be done. Also, allowdupe is now handled like a feature, which is, um, better. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2328 980ebf18-57e1-0310-9a29-db15c13687c0
* Moving some of the stand-alone classes into the util/ subdirectory, to clean ↵luke2007-02-071-1/+1
| | | | | | up the top-level namespace a bit. This is a lot of file modifications, but most of them just change class names and file paths. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2178 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the state-rename branch. This includes the diff from version 2156 ↵luke2007-02-071-340/+377
| | | | | | to 2168. All states should now be properties, with backward compatibility for the types that restricted themselves to the methods. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2169 980ebf18-57e1-0310-9a29-db15c13687c0
* Doing more work on #113. Mostly, just making sure remounts do not happen ↵luke2007-01-291-9/+0
| | | | | | spuriously very often. They will still have extra remounts when changing the value of "ensure", but that is not currently avoidable (similar to #199). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2109 980ebf18-57e1-0310-9a29-db15c13687c0
* Setting up specific allowed types for sshkeyluke2007-01-041-0/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2033 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #388. Paths now look a lot cleaner.luke2006-12-281-1/+14
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1977 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing the explicit load for most types in type.rbluke2006-12-101-2/+2
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1903 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing some Class.to_s handlingluke2006-10-201-8/+2
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1823 980ebf18-57e1-0310-9a29-db15c13687c0
* Using the "trace" configuration parameter to determine whether a stack trace ↵luke2006-09-151-8/+2
| | | | | | should be printed, rather than just using "debug". I added the param a little while ago and was using it internally in Puppet::DevError, but I just now went through the whole configuration and switched to using it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1613 980ebf18-57e1-0310-9a29-db15c13687c0
* Converting Parameter#proxymethods from using eval to using define_methodluke2006-06-271-1/+3
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1324 980ebf18-57e1-0310-9a29-db15c13687c0
* Did some work on making sure object removal actually works, thus stopping ↵luke2006-05-251-0/+4
| | | | | | some potential memory leaks. Also explicitly removed objects in more places, again hopefully forestalling memory leaks. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1224 980ebf18-57e1-0310-9a29-db15c13687c0
* Updating doc system to add the list of valid values to the doc string, and ↵luke2006-05-101-0/+42
| | | | | | tweaking a few docs. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1183 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding filesystem support, and modifying parsedtypes a bit to fix a bug ↵luke2006-04-011-6/+6
| | | | | | where non-instance lines were being duplicated git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1048 980ebf18-57e1-0310-9a29-db15c13687c0
* Parameters and states can now register regexes as allowed values. Also, ↵luke2006-03-091-22/+70
| | | | | | there are (finally) tests associated with params and states, although they should be much more comprehensive. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@999 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding "links" parameter to files, and adding support for following or ↵luke2006-03-041-0/+4
| | | | | | ignoring links to all of the states it can matter to. I still need to modify "source" so that it behaves correctly when managing links. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@983 980ebf18-57e1-0310-9a29-db15c13687c0
* removing extraneous debuggingluke2006-03-031-1/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@978 980ebf18-57e1-0310-9a29-db15c13687c0
* Tracked down a few other bugs; everything now passes on debian in ↵luke2006-02-151-34/+18
| | | | | | preparation for 0.13.2 git-svn-id: https://reductivelabs.com/svn/puppet/trunk@914 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing users so that they can use a group created by Puppet, and they also ↵luke2006-02-151-3/+6
| | | | | | now autorequire that group. To do so, I modified Puppet::Util.gid, which required that I fix Puppet::Type#merge to support merging managed and umanaged objects, which required fixing a bug in Puppet::Type#managed?, and I also changed the ensure state to only default to a value, when the object is managed, which required that I change the defaults system to support default procs that do not return a value. In other words, lots of fixes for a smallish problem, but we are much better off now. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@912 980ebf18-57e1-0310-9a29-db15c13687c0
* Some important bug fixes in the parsedtypes types; this all started from the ↵luke2006-02-151-1/+11
| | | | | | submitted bug today, but I added :absent support to most params. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@910 980ebf18-57e1-0310-9a29-db15c13687c0
* a couple small changes; the most significant is the addition of a ↵luke2006-02-061-6/+9
| | | | | | class-level "eachattr" method, to avoid all of the calls to attrclass and attrtype git-svn-id: https://reductivelabs.com/svn/puppet/trunk@863 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding the event-loop stuff to the repository and switching to using it. ↵luke2006-01-241-8/+4
| | | | | | Also, breaking many classes out into their own class files. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@848 980ebf18-57e1-0310-9a29-db15c13687c0
* Committing most of the scheduling stuff. There is still a bit of work to do ↵luke2006-01-231-3/+110
| | | | | | in terms of how puppetd interacts with scheduling, but the bulk of the work is done. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@847 980ebf18-57e1-0310-9a29-db15c13687c0
* Made lots of small changes, mostly to help usability but also fixed a couple ↵luke2006-01-181-0/+25
| | | | | | of key bugs git-svn-id: https://reductivelabs.com/svn/puppet/trunk@841 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding an "ensure" state where appropriate, and significantly reworking the ↵luke2006-01-171-0/+6
| | | | | | builtin docs. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@832 980ebf18-57e1-0310-9a29-db15c13687c0
* Added "ensure" state to some classes, and added infrastructure for it to ↵luke2006-01-161-12/+14
| | | | | | work elsewhere. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@831 980ebf18-57e1-0310-9a29-db15c13687c0
* Converting transport format to YAML instead of Marshal, and caching the file ↵luke2006-01-121-1/+5
| | | | | | in a YAML format, also. This required a significant rework of both Transportable classes. Lastly, I am also now caching the list of classes in a class file in /etc/puppet. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@816 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixed a couple of warnings, fixed a critical bug having to do with case ↵luke2006-01-121-5/+1
| | | | | | statements (where there is only one listed option), and did a couple of other cleanups. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@814 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging changes from the head of the rework1 branch, r 784luke2006-01-081-0/+196
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@787 980ebf18-57e1-0310-9a29-db15c13687c0
* Undoing the merge that happened in 785luke2006-01-071-196/+0
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@786 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging in refactoring from version 774 into version 784luke2006-01-071-0/+196
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@785 980ebf18-57e1-0310-9a29-db15c13687c0