summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
Commit message (Collapse)AuthorAgeFilesLines
* All tests should now pass again.Luke Kanies2007-10-081-0/+57
| | | | | | | | | | | | | | This is the first real pass towards using caching. The `puppet` executable actually uses the indirection work, instead of handlers and such (and man! is it cleaner). Most of this work was a result of trying to get the client-side story working, with correct yaml caching of configurations, which means this commit also covers converting configurations to yaml, which was a much bigger PITA than it needed to be. I still need to write integration tests, and I also need to cover the server-side story of a normal configuration retrieval.
* This commit is focused on getting the 'puppet' executableLuke Kanies2007-10-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | to work. As a result, it involves a lot of integration-level testing, and a lot of small design changes to make the code actually work. In particular, indirections can now have default termini, so that configurations and facts default to their code terminus Also, I've removed the ability to manually control whether ast nodes are used. I might need to add it back in later, but if so it will be in the form of a global setting, rather than the previous system of passing it through 10 different classes. Instead, the parser detects whether there are AST nodes defined and requires them if so or ignores them if not. About 75 tests are still failing in the main set of tests, but it's going to be a long slog to get them working -- there are significant design issues around them, as most of the failures are a result of tests trying to emulate both the client and server sides of a connection, which normally would have different fact termini but in this case must have the same terminus just because they're in the same process and are global. The next step, then, is to figure that process out, thus finding a way to make this all work.
* Fixing #813 -- empty configurations again work.Luke Kanies2007-10-031-2/+3
|
* Taking a first stab at moving configuration compilingLuke Kanies2007-09-231-0/+4
| | | | | | | | | | | | | | | into the indirection system. There are still quite a few unanswered questions, the two most notable being embodied in unimplemented tests in the Configuration Code terminus. This also requires changing the behaviour in a few places. In particular, 'puppet' and the 'module_puppet' cfengine module need to store a Node object in memory with the appropriate classes, since that's now the only way to communicate with the compiler. That integration work has not yet been done, partially because the old configuration handler (which the soon-to-be-deprecated master handler now uses) still exists.
* Renaming the 'Puppet::Util::Config' class toLuke Kanies2007-09-221-1/+1
| | | | | | | 'Puppet::Util::Settings'. This is to clear up confusion caused by the fact that we now have a 'Configuration' class to model host configurations, or any set of resources as a "configuration".
* Merge branch 'configurations' into indirectionLuke Kanies2007-09-221-16/+245
|\ | | | | | | | | | | | | | | | | Conflicts: lib/puppet/defaults.rb lib/puppet/indirector/facts/yaml.rb spec/unit/indirector/indirection.rb spec/unit/indirector/indirector.rb
| * All tests now pass in this configuration branch, which meansLuke Kanies2007-09-221-14/+26
| | | | | | | | | | | | | | | | it's time to merge it back into the indirection branch. Considering that this work was what drove me to create the indirection branch in the first place, i should now be able to merge both back in the master branch.
| * The structure for handling resource generation is nowLuke Kanies2007-09-221-1/+11
| | | | | | | | | | | | | | | | | | | | in place, which means I'm over the hump in developing this branch. I have to fix some design flaws I made in the configurations, particularly that the 'runner' handler needs to be able to specify tags and whether to ignore schedules, but otherwise, I think it's straightforward test- and bug-fixing from here out.
| * An intermediate commit so I can start working on a differentLuke Kanies2007-09-201-4/+9
| | | | | | | | | | | | | | | | branch. The file recursion code actually works for the first time in a painful while, but there are still some quirks and design issues to resolve, particularly around creating implicit resources that then fail (i.e., the behaviour of the create_implicit_resource method in Configuration).
| * This is basically another intermediate commit. I feel likeLuke Kanies2007-09-171-17/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've gone too far down the rabbit hole to turn back now, but the code is clearly getting more centralized around the Configuration class, which is the goal. Things are currently a bit muddy between recursion, dynamic resource generation, transactions, and the configuration, and I don't expect to be able to clear it up much until we rewrite all of the tests for the Transaction class, since that is when we'll actually be setting its behaviour. At this point, Files (which are currently the only resources that generate other resources) are responsible for adding their edges to the relationship graph. This puts them knowing more than I would like about how the relationship graph works, but it'll have to do for now. There are still failing tests, but files seem to work again. Now to go through the rest of the tests and make them work.
| * Configurations now set a "configuration" instance variable in resources that ↵Luke Kanies2007-09-151-0/+1
| | | | | | | | are inside a configuration, so the resources can interact with the configuration to get things like relationships.
| * The whole system now uses Configuration objects instead ofLuke Kanies2007-09-151-5/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ever converting the Transportable objects into a tree of components and then converting that into a graph. This is a significant step, and drastically simplifies the model of how to use a configuration. The old code might have looked something like this: file = Puppet::Type.create :path => "/whatever", ... comp = Puppet::Type.create :name => :whatever comp.push file transaction = comp.evaluate transaction.evaluate The new code looks like this: file = Puppet::Type.create :path => "/whatever", ... config = Puppet::Node::Configuration.new config.add_resource file config.apply I did not really intend to do this much refactoring, but I found I could not use a Configuration object to do work without refactoring a lot of the system. The primary problem was that the Client::Master and the Config classes determined how the transactions behaved; when I moved to using a Configuration, this distinction was lost, which meant that configurations were often needing to create other configurations, which resulted in a whole lot of infinite recursion (e.g., Config objects that create directories for Puppet use Configuration objects -- yes, I'm s/Config/Settings/g soon -- and these Configuration objects would need to create directories). Not everything is fixed, but it's very close. I am clearly over the hump, though, so I wanted to get a commit in.
* | The indirector specs now all pass. I think I needLuke Kanies2007-09-211-1/+1
| | | | | | | | to add a few more specs, though.
* | Fixing all existing spec tests so that they nowLuke Kanies2007-09-201-3/+3
|/ | | | | | pass given the redesign that Rick implemented. This was mostly a question of fixing the method names and the mocks.
* Moving the resource container behaviour to the Configuration object, rather ↵Luke Kanies2007-09-121-1/+26
| | | | than the base PGraph class. I expect I will just do away with PGraph, but for now, I am at least going to keep configuration-related code in that class.
* Another intermediate commit. The node and fact classes are now functional ↵Luke Kanies2007-09-121-11/+11
| | | | and are used instead of the network handlers, which have been removed. There are some failing tests as a result, but I want to get this code committed before I massage the rest of the system to make it work again.
* The Node handler is now obsolete. Node searching is handled through the ↵Luke Kanies2007-09-111-0/+106
| | | | indirector. I have not yet added the tests for the node handlers themselves, which is next.
* Doing an intermediate commit so rick can look at the work I have done so far.Luke Kanies2007-09-111-0/+36
|
* Flipped the switch so that compiles now return a Configuration instance ↵Luke Kanies2007-09-041-1/+1
| | | | instead of pre-extracting the configuration.
* We now have a real configuration object, as a subclass of GRATR::Digraph, ↵Luke Kanies2007-09-041-0/+123
that has a resource graph including resources for the container objects like classes and nodes. It is apparently functional, but I have not gone through all of the other tests to fix them yet. That is next.