summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
Commit message (Collapse)AuthorAgeFilesLines
* Allowing Environment.new to take an environmentLuke Kanies2010-02-171-0/+1
| | | | | | | | | This can happen because we're almost always converting to environment instances from strings. Shouldn't happen often, but it's easier to be more failure-tolerant. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding an environment helperLuke Kanies2010-02-171-0/+14
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* REST: hide Request objectJesse Wolfe2010-02-171-1/+1
| | | | | | This change to the REST branch restores some sanity by explicitly allowing a destination URL for indirector save() calls, removing a hack that I was using to accomplish this.
* Renaming Parser::ResourceType to Resource::TypeLuke Kanies2010-02-171-1/+1
| | | | | | | | | | Basically, these classes (ResourceType and ResourceTypeCollection) don't really belong in Parser, so I'm moving them to the Resource namespace. This will be where anything RAL-related goes from now on, and as we migrate functionality out of Puppet::Type, it should go here. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding 'known_resource_types' to EnvironmentLuke Kanies2010-02-171-0/+8
| | | | | | | Each environment now has its own known collection of resource types, and it is responsible for caching as necessary. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing #3407 Failing tests in spec/unit/node/environment.rbJesse Wolfe2010-03-221-1/+7
| | | | | | | | | A naked rescue in Puppet::Node::Environment was hiding expectation violations from the Mocha mocks. Specifically, 'modulepath' expectations were failing, as Puppet::Module now calls Puppet::Node::Environment#modulepath internally. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Add Environment#manifestdir and small refactoringBrice Figureau2009-11-151-9/+20
| | | | | | | | This adds a new environment cached attribute: manifestdir. It is modeled on the code of modulepath, but returns the manifestdir. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Refactoring the Module/Environment co-interfaceLuke Kanies2009-08-181-6/+2
| | | | | | | This simplifies who owns what code in these two classes, and the result should be much cleaner and simpler. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1544 - plugins in modules now works againLuke Kanies2009-08-181-0/+1
| | | | | | | | | | | | We had to fix the fileserving plumbing to use the request environment instead of trying to use the node environment. This was apparently never fixed after we added the environment to the URI in REST calls. There's still a bit of refactoring left to clean up the APIs used in some of this code. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding caching to the Environment classLuke Kanies2009-05-201-2/+18
| | | | | | | | | | | Caching the module path (because we check which directories exist, and this method can get called often), and the complete list of modules. The cache ttl uses the filetimeout, which defaults to 15 seconds. Signed-off-by: Luke Kanies <luke@madstop.com>
* Modules now can find their own pathsLuke Kanies2009-05-151-5/+3
| | | | | | | | | | | | Previously, when you created a module you had to specify the path. Now Module instances can use the module path to look up their paths, and there are methods for determining whether the module is present (if the path is present). Also cleaned up the methods for figuring out what's in the module (plugins, etc.). Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding REST::Handler methods for converting between indirection and urisLuke Kanies2009-03-201-0/+4
| | | | | | | | | | This is the first main phase to having a common module for handling the REST api - this Handler module will be included by all of the web server REST modules and the Indirector Request class, so there's a common place that understands how the URI consists. Signed-off-by: Luke Kanies <luke@madstop.com>
* Environments now use their own modulepath method.Luke Kanies2009-02-181-2/+2
| | | | | | They were previously still using just the variable itself. Signed-off-by: Luke Kanies <luke@madstop.com>
* The 'Environment' class can now calculate its modulepath.Luke Kanies2009-02-181-0/+16
| | | | | | | | | | | This includes adding PUPPETLIB from the shell environment. I'm moving responsibility for this from the Module class, because nearly every method in Puppet::Module accepted 'environment' as its argument, which is a good sign that it's on the wrong class. Signed-off-by: Luke Kanies <luke@madstop.com>
* Added support for finding modules from an environmentLuke Kanies2009-02-181-0/+17
| | | | | | | | This uses the environment to search for the modules, rather than relying on the Puppet::Module class to know how to handle environments. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring how the Facter integration worksLuke Kanies2009-02-061-0/+21
| | | | | | | | I moved all of the extra Fact modifications into the Facts class, and then moved the calls of those new methods into the Facter terminus. Signed-off-by: Luke Kanies <luke@madstop.com>
* Renaming Puppet::Node::Catalog to Puppet::Resource::CatalogLuke Kanies2008-12-181-508/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Renaming Puppet::ResourceReference to Puppet::Resource::ReferenceLuke Kanies2008-12-091-2/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* These changes are all about making sure file data is expired when appropriate.Luke Kanies2008-11-151-0/+4
| | | | | | All file tests now pass. Signed-off-by: Luke Kanies <luke@madstop.com>
* Catalogs always consider resource data to be expired if not mid-transaction.Luke Kanies2008-11-151-0/+8
| | | | | | | | | This way we'll cache when in a transaction, but otherwise always hit the disk so the data is fresh. This works because we really only use resources mid-transaction, but it behaves correctly if we happen to use a resource outside of a transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding cached attribute support to resources.Luke Kanies2008-11-111-0/+6
| | | | | | | | | | | | The Catalog is the expirer, which means that a resource with no catalog will not cache data. Also switching files to use a cached attribute for its stat. And modifying catalogs to expire data at the end of every transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring Catalog#add_resource to correctly handle implicit resources.Luke Kanies2008-11-071-36/+31
| | | | | | | | | | | | | | It now ignores or removes implicit resources that conflict, and it yields all resources that are valid. This makes it simple for calling classes to pass in a list of resources but only perform a chunk of work for valid (i.e., non-conflicting) resources. This refactor is entirely meant as a way of cleaning up the Transaction#generate interface to the catalog. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing mention of obsolete edgelist_class from GRATR.Luke Kanies2008-11-061-16/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Changing the catalog's relationship graph into a normal graph.Luke Kanies2008-11-061-8/+3
| | | | | | | It was previously another catalog instance, but I was only ever actually using the graphing abilities. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing the PGraph class and subsuming it into SimpleGraph.Luke Kanies2008-11-061-22/+7
| | | | | | | This class is a holdover from when I was using GRATR, and it's obsolete now. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing mid-transaction resources from the catalog.Luke Kanies2008-11-051-1/+1
| | | | | | This basically just cleans up dynamic resources. Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,Luke Kanies2008-10-171-17/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | since that method is deprecated. Conflicts: CHANGELOG bin/puppetca lib/puppet/file_serving/fileset.rb lib/puppet/network/xmlrpc/client.rb lib/puppet/type/file/selcontext.rb spec/unit/file_serving/metadata.rb spec/unit/type/file.rb
| * Fixing #1614 - Environments no longer have to be listed out.Luke Kanies2008-10-031-17/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-07-041-0/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/util/settings.rb spec/integration/defaults.rb spec/unit/node/catalog.rb spec/unit/type/interface.rb spec/unit/type/ssh_authorized_key.rb
| * Backporting a test that was failing in master, and fixing itLuke Kanies2008-07-021-0/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-07-021-1/+6
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: CHANGELOG spec/unit/node/catalog.rb spec/unit/type/package.rb spec/unit/type/schedule.rb spec/unit/type/service.rb spec/unit/util/settings.rb
| * Fixed #1221 - aliases to titles now work for resources.Luke Kanies2008-06-161-1/+6
| |
* | Merge branch '0.24.x'Luke Kanies2008-05-251-0/+3
|\| | | | | | | | | | | | | Conflicts: CHANGELOG lib/puppet/transaction.rb
| * Removing extra debuggingLuke Kanies2008-05-221-1/+0
| |
| * Fixing the node/catalog so that it can convert from parser catalogs to RAL ↵Luke Kanies2008-05-221-0/+4
| | | | | | | | | | | | | | | | | | | | catalogs. It largely worked previously, except when aliases were set, which require catalogs. This now converts all parser resources to trans_objects then to RAL resources, and sets the catalog in the meantime. This allows aliases to work just fine when converting directly from parser catalogs to RAL catalogs.
* | Merge branch '0.24.x'Luke Kanies2008-04-111-1/+9
|\|
| * Fixing the expire method (it wasn't using a requestLuke Kanies2008-04-101-1/+9
| | | | | | | | | | | | internally), and fixing the Facts class so it auto-expires any associated cached nodes when facts are saved.
* | Fixing tests that were failing as a result of the merge,Luke Kanies2008-04-011-1/+1
| | | | | | | | | | including removing some now-obsolete code and tests from the Settings class.
* | Merge branch 'master' into master_no_global_resourcesLuke Kanies2008-03-312-37/+59
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/node/catalog.rb lib/puppet/type/pfile.rb lib/puppet/type/pfilebucket.rb lib/puppet/util/filetype.rb spec/unit/node/catalog.rb spec/unit/other/transbucket.rb spec/unit/ral/provider/mount/parsed.rb spec/unit/ral/types/file.rb spec/unit/ral/types/interface.rb spec/unit/ral/types/mount.rb spec/unit/ral/types/package.rb spec/unit/ral/types/schedule.rb spec/unit/ral/types/service.rb test/language/compile.rb test/language/lexer.rb test/language/snippets.rb test/lib/puppettest.rb test/ral/types/basic.rb test/ral/types/cron.rb test/ral/types/exec.rb test/ral/types/file.rb test/ral/types/file/target.rb test/ral/types/filebucket.rb test/ral/types/fileignoresource.rb test/ral/types/filesources.rb test/ral/types/group.rb test/ral/types/host.rb test/ral/types/parameter.rb test/ral/types/sshkey.rb test/ral/types/tidy.rb test/ral/types/user.rb test/ral/types/yumrepo.rb
| * Found all instances of methods where split() is used withoutLuke Kanies2008-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | any local variables and added a local variable -- see http://snurl.com/21zf8. My own testing showed that this caused memory growth to level off at a reasonable level. Note that the link above says the problem is only with class methods, but my own testing showed that it's any method that meets these criteria. This is not a functional change, but should hopefully be the last nail in the coffin of #1131.
| * Fix for 1094Luke Kanies2008-03-061-0/+10
| | | | | | | | | | | | Replace the catalog with the newly created one when converting to ral types. The aliases were being lost because the resources had references to the old catalog being converted
| * Fixing #1084 -- the node catalog asks the individualLuke Kanies2008-02-251-1/+1
| | | | | | | | | | | | resources whether they're isomorphic, and they in turn ask the resource types (or default to true for defined resource types).
| * Somewhat refactored fileserving so that it no longer cachesLuke Kanies2008-02-231-2/+7
| | | | | | | | | | | | | | | | | | | | any objects, nor does it use Puppet's RAL resources. In the process, I fixed #894 (you can now copy links) and refactored other classes as necessary. Mostly it was fixing tests. This is a squashed commit of a temporary branch, fwiw, and it also includes any fixes to the tests that were necessary to get all tests passing again.
| * Fixed #1018 -- resources now have their namevars added asLuke Kanies2008-02-181-1/+8
| | | | | | | | | | aliases in the resource catalog, just like they were added in the resource classes.
| * Removing the last remaining vestiges of GRATR --Luke Kanies2008-02-111-5/+5
| | | | | | | | removing the bangs from 'add_vertex!' and 'add_edge!'.
| * Switching the Node catalog to use the Tagging moduleLuke Kanies2008-02-111-25/+4
| | | | | | | | instead of its own tag methods.
| * Switching the Node Catalog to using a separate methodLuke Kanies2008-02-111-29/+27
| | | | | | | | | | | | for validating that a given resource is unique within the catalog. This no longer allows any duplication, even with Execs.
| * Fixed #1030 - class and definition evaluation has been significantlyLuke Kanies2008-02-111-0/+5
| | | | | | | | | | | | refactored, fixing this problem and making the whole interplay between the classes, definitions, and nodes, and the Compile class much cleaner.
| * Converting the Compile class to use a Node::Catalog instanceLuke Kanies2008-02-111-1/+25
| | | | | | | | | | as its resource container, instead of having its own behaviour around resource uniqueness.
* | Fixing automatic relationships. I was previously looking themLuke Kanies2008-01-141-1/+1
| | | | | | | | | | up in the relationship graph, which only stores the vertices, not the resource table.