summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fixing #2403 - provider specificity is richer and betterLuke Kanies2009-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | We have extended the concept of provider specificity so it now includes both specified defaults and class depth, so: * We are much more likely to choose the correct provider; e.g., 'init' will be chosen over 'base' * We're much less likely to print this warning, because it's only printed when provider specificities are equal which is much rarer lib/puppet/provider.rb | 4 ++-- lib/puppet/type.rb | 4 ++-- spec/unit/type.rb | 17 +++++++++++++++++ test/ral/manager/type.rb | 22 ---------------------- 4 files changed, 21 insertions(+), 26 deletions(-) Signed-off-by: Luke Kanies <luke@madstop.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-2/+2
|
* Fixing all of the test/ tests I broke in previous dev.Luke Kanies2008-12-181-1/+1
| | | | | | | | | Most of these are straightforward changes to the tests, but a couple required small refactorings (e.g., References can now be created with Puppet::Type instances, and they know how to extract the type/title from them). Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving all confine code out of the Provider class, and fixing #1197.Luke Kanies2008-05-151-36/+7
| | | | | | | | | I created a Confiner module for the Provider class methods, and then I enhanced the interface between it and the Confine class to make sure binary paths are searched for fresh each time. This fixes #1197, which was a result of binary paths being searched for at startup, rather than at execution.
* Switching the Provider class to use the new Confiner class.Luke Kanies2008-05-151-68/+11
|
* Rewriting the tests for the package resource type, fixing #930.Luke Kanies2007-11-261-0/+5
|
* Fixing the 'mount' tests so that they no longerLuke Kanies2007-11-081-10/+10
| | | | | modify the local system and they run fine as non-root users.
* Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
|
* The last set of bug-fixes before the next release. This commit just fixes a ↵luke2007-08-071-1/+1
| | | | | | couple of problems that resulted when I changed the Provider#initialize method to not duplicate its argument, which was necessary for ParsedFile. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2753 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #749 -- environment settings no longer accumulate. Significantly ↵luke2007-08-061-1/+3
| | | | | | adding to the cron tests at the same time, such that hopefully we will no longer have these recurring bugs. I now do every combinatorial of multi-line cron jobs, including doing them all in one file. There are, unfortunately, still edge cases, but maybe we will have some peace in cron space for a while, anyway. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2750 980ebf18-57e1-0310-9a29-db15c13687c0
* Trying to load ruby gems, in case needed libraries are installed that way, ↵luke2007-06-151-1/+1
| | | | | | and fixing a warning in the provider git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2588 980ebf18-57e1-0310-9a29-db15c13687c0
* A few small fixes here and there, and the rest of the zones commitluke2007-06-141-0/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2577 980ebf18-57e1-0310-9a29-db15c13687c0
* Finishing off the type/provider interface work, including adding package ↵luke2007-06-081-0/+5
| | | | | | prefetch for all packages. The only not-done one is yum -- prefetch is set up for rpm, but not yum. We need to modify prefetching so that it also prefetches latest information, to avoid having to run yum so many times. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2555 980ebf18-57e1-0310-9a29-db15c13687c0
* Significantly reworked the type => provider interface with respect toluke2007-06-041-7/+31
| | | | | | | | | | | | | | | | | | | | listing existing provider instances. The class method on both class heirarchies has been renamed to 'instances', to start. Providers are now expected to return provider instances, instead of creating resources, and the resource's 'instances' method is expected to find the matching resource, if any, and set the resource's provider appropriately. This *significantly* reduces the reliance on effectively global state (resource references in the resource classes). This global state will go away soon. Along with this change, the 'prefetch' class method on providers now accepts the list of resources for prefetching. This again reduces reliance on global state, and makes the execution path much easier to follow. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2551 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a "source" attribute to providers, so eventually types will be able ↵luke2007-06-041-0/+14
| | | | | | to avoid duplication during listing by only listing one provider for each source (e.g., dpkg and aptitude should not both be listed). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2550 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #605 -- providers now refer to @resource or @resource_type.luke2007-05-091-22/+30
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2501 980ebf18-57e1-0310-9a29-db15c13687c0
* Intermediate commit of more reference work, including making provider ↵luke2007-05-081-7/+26
| | | | | | suitable more introspectable. I am about to significantly change the output format of the providers reference, so i want to get this committed before that change. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2485 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a "supports_parameter?" method to test whether a given provider ↵luke2007-05-011-0/+18
| | | | | | supports the features required by a given parameter. This is used during attribute instance creation, but its creation was necessicated by test code. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2444 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding purge => true to downloading of facts and plugins, and removing some ↵luke2007-04-301-1/+0
| | | | | | extraneous logging from the provider base class git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2435 980ebf18-57e1-0310-9a29-db15c13687c0
* Apparently I messed up providers a bit; binaries were not having their full ↵luke2007-04-271-0/+2
| | | | | | paths returned, which made most providers suddenly unsuitable. This fixes that, and adds tests to verify behaviour. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2426 980ebf18-57e1-0310-9a29-db15c13687c0
* Closing #585 -- providers can now have optional commands, which only differ ↵luke2007-04-271-35/+56
| | | | | | from normal commands in that they do not affect a provider's suitability git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2425 980ebf18-57e1-0310-9a29-db15c13687c0
* Hopefully the last batch of commits before I release 0.22.2. Mostly just ↵luke2007-03-191-2/+6
| | | | | | get tests to pass. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2334 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a "has_feature" method, so a provider can just declare that it has a ↵luke2007-03-191-1/+12
| | | | | | given feature git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2327 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding provider features. Woot!luke2007-03-191-0/+8
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2313 980ebf18-57e1-0310-9a29-db15c13687c0
* Significantly reworking the internals of the fileparsing code. It nowluke2007-03-141-0/+17
| | | | | | | | | | | | | | passes around an instance of a FileRecord, rather than just a hash, which I think makes it much easier to understand. Moved the sshkey parsed provider test to its own directory and made it better. This work is all being done so I can move cron jobs to using providers instead of the current unmaintainable state of affairs. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2281 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #372 and #374. All is not perfect, since OS X still cannot set UID, ↵luke2006-12-191-8/+11
| | | | | | but it is much better. There is still plenty of bug-fixing to do on other platforms, I expect. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1954 980ebf18-57e1-0310-9a29-db15c13687c0
* Mounts work again, at least with the parsedfile provider. I still need to ↵luke2006-11-121-1/+5
| | | | | | create a netinfo provider, but it should be short and easy. And, painfully, I still need to port the other six or so subclasses to this new provider. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1859 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the code over from the oscar branch. I will now be doing all ↵luke2006-11-081-2/+4
| | | | | | development in the trunk again, except for larger changes, which will still get their own branch. This is a merge of the changes from revision 1826 to revision 1834. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1835 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing some Class.to_s handlingluke2006-10-201-0/+1
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1823 980ebf18-57e1-0310-9a29-db15c13687c0
* Another round of bug-fixes in preparation for 0.20.0luke2006-10-181-2/+6
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1813 980ebf18-57e1-0310-9a29-db15c13687c0
* Ported mount over to using providersluke2006-10-171-0/+11
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1801 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing provider commands and Util#execute so they always include the command ↵luke2006-09-191-11/+3
| | | | | | output when possible, as mentioned on the list git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1635 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding testing for the default? method, and fixing it to support arrays and ↵luke2006-09-151-6/+11
| | | | | | returning false when no defaults are specified git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1614 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding test code for providers that makes sure the default and confine ↵luke2006-09-131-22/+34
| | | | | | mechanisms work internally. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1582 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #261. Applied patch, with small modifications.luke2006-09-131-1/+6
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1579 980ebf18-57e1-0310-9a29-db15c13687c0
* Modifying the provider base class so that it defines a method for every used ↵luke2006-09-061-0/+18
| | | | | | command (e.g., you call "commands :rpm => 'rpm'", and it defines an "rpm" method. I then pushed this throughout the package providers, which are the heaviest users of commands. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1571 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing all of the changes I made towards refactoring in the last couple of ↵luke2006-09-051-5/+2
| | | | | | days. They have all been moved into the sync-retrieve-refactor branch. This branch will soon become 0.19.0, and will not include that refactoring. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1555 980ebf18-57e1-0310-9a29-db15c13687c0
* Beginning the process of moving parsedtypes to a provider. Each parsedluke2006-09-031-2/+5
| | | | | | | | | | | | | | | | | | type will have a parsedfile provider, which will be responsible for all of the file parsing and generation. This should allow us to create a useful DSL for file handling, but it also *drastically* simplifies these types. These types have always been a bit fragile, and it was never quite clear who was responsible for what. Now, with the type/provider split, everything is much clearer. I still need to convert host, sshkey, and mount, and something needs to be done with cron. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1547 980ebf18-57e1-0310-9a29-db15c13687c0
* Removing type/provider references on type removalluke2006-09-021-0/+6
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1525 980ebf18-57e1-0310-9a29-db15c13687c0
* fixing provider commands; I broke them when making them easier to documentluke2006-08-291-0/+2
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1513 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a module specifically for making doc generation easier, and adding ↵luke2006-08-281-11/+13
| | | | | | defaults info to provider docs. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1504 980ebf18-57e1-0310-9a29-db15c13687c0
* Modifying providers so that docs generate betterluke2006-08-281-4/+25
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1502 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging r1468 from the implementations branch with r1438 from when the ↵luke2006-08-141-0/+134
branch was first created. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1469 980ebf18-57e1-0310-9a29-db15c13687c0