summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
Commit message (Collapse)AuthorAgeFilesLines
* Adding clarity to query string handling in REST callsLuke Kanies2009-02-183-1/+19
| | | | | | | | | | | | We previously only handled simple strings as values, but we know handle true and false as booleans, we URI-escape all strings, and we can yaml-encode and then escape arrays of strings. This could get abused a bit, in that we're just yaml-dumping anything that's an array, but it should be pretty safe. Mmmm, should. Signed-off-by: Luke Kanies <luke@madstop.com>
* Providing better information when an exception is encountered during network ↵Luke Kanies2009-02-181-1/+1
| | | | | | communication Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2009-02-131-53/+113
|\ | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/indirector/facts/facter.rb lib/puppet/provider/augeas/augeas.rb lib/puppet/util/filetype.rb spec/unit/indirector/facts/facter.rb spec/unit/provider/augeas/augeas.rb test/util/filetype.rb
| * Fixing #961 - closing the http connection after every xmlrpc callLuke Kanies2009-02-121-1/+3
| | | | | | | | | | | | | | | | There were apparently some circumstances that resulted in the connection not being closed; this just closes it every time if it's still open after the rpc call is complete. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Refactoring the XMLRPC::Client error-handlingLuke Kanies2009-02-121-53/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I split it all into smaller, manageable chunks, and used methods for each step, instead of having one huge call. Note that I made all of the tests first, then refactored the code, so I'm confident there's no behavior change. I don't know that this is actually a lot cleaner, but it seems that way to me. I'm open to skipping this, but I think it makes the whole thing a lot cleaner. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding an Agent::Runner class.Luke Kanies2009-02-061-42/+9
| | | | | | | | | | | | | | This will eventually be used by puppetrun, but for now is just called by the old-school Runner handler. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Creating and using a new Puppet::Daemon classLuke Kanies2009-02-062-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | This replaces the short-lived EventManager class, all of the service- and timer-related code in puppet.rb, and moves code from agent.rb, server.rb, and other places into one class responsible for starting, stopping, pids, and more. The Daemon module is no longer in existence, so it's been removed from the classes that were using it. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Not using 'master' client for testingLuke Kanies2009-02-061-2/+0
| | | | | | | | | | | | | | That class is gone, so until the Client class is no longer necessary, using a different class. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding better error-handling to format renderingLuke Kanies2009-02-061-4/+39
| | | | | | | | | | | | | | We now always get the format name and the method that failed. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Renmaing Puppet::Network::Client::Master to Puppet::AgentLuke Kanies2009-02-061-523/+0
| | | | | | | | | | | | | | | | | | Made minor changes, including removing the parent class. The functionality hasn't changed yet -- that comes in later patches -- but all but a couple of the older tests pass. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #1729 - puppetmasterd can now read certs at startupLuke Kanies2008-12-182-4/+7
| | | | | | | | | | | | | | | | | | | | The main aspect of this solution is to create a site-wide Puppet::SSL::Host instance to cache ssl key and certificate, so that by the time we've switched UIDs, we've got the key and cert in memory. Then webrick just uses that, rather than creating a new Host instance. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Deprecating the Puppet::Type.create.Luke Kanies2008-12-182-2/+2
| | | | | | | | | | | | | | This method is no longer necessary; you can use the normal 'new' class method. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Deprecating 'Puppet.type'; replacing all instances with Puppet::Type.typeLuke Kanies2008-12-182-3/+3
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Renaming Puppet::Node::Catalog to Puppet::Resource::CatalogLuke Kanies2008-12-182-2/+2
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-12-022-2/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 splaytime testsLuke Kanies2008-12-011-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixing #1749 - Splay now hopefully behaves "better" for small values.Luke Kanies2008-12-011-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Removing the included testing gems; you must now install them yourself.Luke Kanies2008-11-251-1/+3
| | | | | | | | | | | | Everything passes, but autotest doesn't include color. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring the Cacher interface to always require attribute declaration.Luke Kanies2008-11-111-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously you could dynamically use cached values, but the new interface requires a single static declaration of the attribute: cached_attr(:myattr) { my_init_code() } This is cleaner, because it makes it easy to turn the code into an init method and generally makes the whole thing easier to think about. Most of this commit is going through the different classes that already using the Caching engine. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Changing the Cacher.invalidate method to Cacher.expire.Luke Kanies2008-11-111-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,Luke Kanies2008-10-174-52/+191
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 the broken tests resulting from the fix for #1551.Luke Kanies2008-10-081-1/+1
| | | | | | | | | | | | The test was expecting the current time, albeit as an integer. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fix #1636 - part2 - correct some client errors.Brice Figureau2008-10-091-3/+7
| | | | | | | | | | | | | | | | | | #1636 original patch was incomplete, and on some cases, the client could report: "Failed to generate additional resources during transaction: None of the provided sources exist" The server was trying to recurse when asking to list files and thus was returning an empty response instead of a "file" response.
| * Fix several small regressions in plugins mountBrice Figureau2008-10-091-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since a30ecf2aeffd71960bd806fb28cd6d1b8adc2452, reclist has one parameter less, but Puppet::Network::Handler::PluginMount.list wasn't ported to the new API. While mounting plugins, reclist wasn't requiring 'file_serving/fileset', leading to an NameError. The change to the new API meant that we lost the existance test of plugins mount directory. It was failing when the client was mounting module plugins that weren't existing (like facter and no custom facts defined). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fixed #1473 - Rescue Timeout::Error in xmlrpc clientsAndrew Shafer2008-10-071-4/+4
| | | | | | | | | | Added a rescue block for Timeout::Error (which isn't a subclass of StandardError) Removed a Dev Error conditional to facilitate testing
| * Fixing #947 - pluginsync no longer fails poorly when no plugins existLuke Kanies2008-10-031-2/+4
| | | | | | | | | | | | Note that it still fails -- it's just a more reasonable failure. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixed error message typoJames Turnbull2008-10-031-1/+1
| |
| * Fixed #1603 - Added support for running Puppet inside a Rack applicationJames Turnbull2008-09-301-0/+148
| |
| * Make fileserver use fileset for recursion and handle dangling links by ↵Paul Nasrat2008-09-301-41/+24
| | | | | | | | ignoring them fixing #1544
* | Merge branch 'feature/master/1481'Luke Kanies2008-09-237-8/+51
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This merges in the new fileserving code -- we're now using REST to do fileserving, rather than xmlrpc. Conflicts: lib/puppet/parameter.rb lib/puppet/type/file.rb spec/unit/type/file.rb
| * | Adding automatic attribute collection to the new fileserving code.Luke Kanies2008-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically, this just includes a consistent method for collecting info (either content or metadata) and then calls that method when returning instances via the indirector. It's such a large commit mostly because of small changes in the normal code and large changes in the testing to accomodate those small changes. Signed-off-by: Luke Kanies <luke@madstop.com>
| * | Causing format selection to fail intelligently if no suitable format can be ↵Luke Kanies2008-08-261-1/+12
| | | | | | | | | | | | | | | | | | picked. Signed-off-by: Luke Kanies <luke@madstop.com>
| * | Fixing the rest backends for webrick and mongrel so the get the whole ↵Luke Kanies2008-08-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | request key. Also adding the Content work necessary to demonstrate that this is actually required. Signed-off-by: Luke Kanies <luke@madstop.com>
| * | Adding weights to network formats, and sorting them based on the weight.Luke Kanies2008-08-263-3/+14
| | | | | | | | | | | | | | | | | | | | | This way the new hackish RAW format will only ever be used if it's specifically chosen. Signed-off-by: Luke Kanies <luke@madstop.com>
| * | Adding a hackish raw format.Luke Kanies2008-08-261-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | As the comment in the file says, we don't really have enough data to know what a good design would look like, and I think this format will be a bit of a one-off, so I'm just throwing up some barriers to keep people from doing silly things with it. Signed-off-by: Luke Kanies <luke@madstop.com>
| * | Adding suitability as a requirement for a format being supported.Luke Kanies2008-08-261-1/+2
| | | | | | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | | Merge branch '0.24.x'Luke Kanies2008-09-232-9/+9
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | Conflicts: lib/puppet/metatype/container.rb lib/puppet/metatype/instances.rb lib/puppet/metatype/metaparams.rb lib/puppet/metatype/relationships.rb lib/puppet/metatype/schedules.rb
| * Only apply splay the first runAndrew Shafer2008-09-211-8/+8
| | | | | | | | Issue 1491
| * Fixes #1551 puppetmaster.freshness xmlrpc call returns incorrect typeNigel Kersten2008-09-051-1/+1
| |
* | Adding parameter and URL support to the REST terminus.Luke Kanies2008-08-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the server side correctly pulled parameters out of the query strings, but the REST terminus never passed them on. It does now, at least for finding and searching. It appears that at least WEBrick doesn't support parameters for anything other than forms and GET. I've also added the ability for the REST terminus to pull host/port information from the request key, if it's a URI. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing the String format (fixes #1522).Luke Kanies2008-08-202-17/+5
| | | | | | | | | | | | | | | | | | The string format no longer provides any support methods, which means that I had to create to_multiple_s and from_multiple_s methods on the SSL classes. I created them in the base class and tested them just in the cert class. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-08-181-3/+4
|\| | | | | | | | | | | | | Conflicts: CHANGELOG test/util/posixtest.rb
| * Ensure that we consistently use either string #{} interpolation or String.%Daniel Pittman2008-08-011-3/+4
| | | | | | | | | | | | | | interpolation, not both, to avoid issues where a #{} interpolated value contains a % character. Signed-off-by: Daniel Pittman <daniel@rimspace.net>
* | Certificates now work over REST.Luke Kanies2008-08-071-3/+1
| | | | | | | | | | | | | | | | | | All of the format work is done, they all support plaintext successfully, and I've got integration tests that demonstrate that it actually works. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Enhancing formatting errors with class and format.Luke Kanies2008-08-041-4/+4
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding a plaintext network format.Luke Kanies2008-08-041-2/+22
| | | | | | | | | | | | Certs don't seem to support yaml, for some reason. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Correctly handling when REST searches return nothing.Luke Kanies2008-07-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We return a 404, which the client can correctly handle. That wasn't the actual problem causing failing tests, of course -- the problem was that one side of our stub was autodetecting marshal, and the other side was forcing yaml, which strangely didn't work. It was only happening with searching, though, not finding et al. The 'search returning nil' problem was a bit of a red herring but needed to be fixed, too. Signed-off-by: Luke Kanies <luke@madstop.com>
* | The REST formats are now fully functional, with yaml and marshal support.Luke Kanies2008-07-302-14/+52
| | | | | | | | | | | | | | | | This is the last of the REST plumbing. The only flaw right now is that the formats are managed by name rather than by mimetype, which I'll fix next. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding some support for case insensivity in format names.Luke Kanies2008-07-302-5/+9
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving validation from FormatHandler to Format.Luke Kanies2008-07-302-9/+2
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>