summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | Adding environment support to the REST URILuke Kanies2009-03-202-7/+28
| | | | | | | | | | | | Also adding it to the Indirection Request. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving the query_string method to RequestLuke Kanies2009-03-202-22/+22
| | | | | | | | | | | | | | | | It required a request instance and didn't use the REST class it was in, so it makes more sense in the Request class. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #2108 - pi should work againLuke Kanies2009-03-201-6/+8
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fix #1088 - Collections overridesBrice Figureau2009-03-144-721/+860
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset defines a new syntax to override collection of resources (virtual or not). This feature is not constrained to the override in inherited context as usual resource override. The collection of resource supports a query like regular collection of virtual or exported resources. Usage example: file { "/tmp/testing": content => "whatever" } File<| |> { mode => 0600 } It also introduces a different behaviour for collection of catalog resources. Before this patch, only virtual resources were collected, now all resources (virtual or no) are collected and can be overriden. That means it is now possible to do: File <| |> { mode => 0600 } And all the Files resources will have mode 0600. It is then possible to have this puppet pattern: file { "/tmp/a": content => "a" } file { "/tmp/b": content => "b" } File <| title != "/tmp/a" |> { require => File["/tmp/b"] } which means that every File requires a file. Moreover it is now possible to define resource overriding without respecting the override on inheritance rule: class a { file { "/tmp/testing": content => "whatever" } } class b { include a File<| |> { mode => 0600 } } include b Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Fixing #1949 - relationships now use attributes instead of a labelLuke Kanies2009-03-102-32/+23
| | | | | | | | | | | | | | | | | | | | | | This was important because the use of the label to store attributes was a holdover from the GRATR library, and if we didn't cease its use before we switched to RESTful catalogs, then we'd be stuck with the @label instance variable forever, essentially. Now we can add and remove variables however we please. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Correctly handling numerical REST argumentsLuke Kanies2009-03-102-0/+3
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Not passing file sources on to child filesLuke Kanies2009-03-101-1/+1
| | | | | | | | | | | | | | This was sometimes causing files to get converted to directories. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Correctly handling non-string checksumsLuke Kanies2009-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Content is now returning the checksum rather than the actual content, and the method of creating the full checksum wasn't correctly handling timestamps, which aren't strings and can't be the right side of a String + call. I've opened #2064 as a better long-term fix. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing unnecessary calls to expire()Luke Kanies2009-03-102-2/+0
| | | | | | | | | | | | | | | | | | These calls were resulting in 1-2 extra round trips per file. For simple comparison, 200 empty files took 73s before this change and 20s after. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Passing checksums around instead of file contentsLuke Kanies2009-03-053-25/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches the file's 'content' parameter to always use checksums, rather than always using content but switching to checksums whenever necessary. This greatly simplifies all the logging requirements (so that content doesn't show up in logs), but also simplifies insync comparisons, and much more. In the process, I found that the code was pulling down file content more often than was necessary, and fixing that cut 40% off of the time of a very small transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving default fileserving mount creation to the Configuration classLuke Kanies2009-03-052-8/+9
| | | | | | | | | | | | | | | | | | | | It was previously in the parser, but the parser is only created if the fileserver.conf exists, so the default mounts weren't made if the file didn't exist. This is a bit less encapsulation, but not much. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #2028 - Better failures when a cert is found with no keyLuke Kanies2009-02-281-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that the server had a certificate for the client. Initially the client just didn't have a key, because it assumed that if it had a certificate then it had a key. Upon fixing it to create the key, the key then did not match the found certificate. This commit fixes both of those: The key is always found before the certificate, and when the certificate is found it's verified against the private key and an exception is thrown if they don't match. It's always a failure, so this just makes the failure more informative. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving the clientyamldir setting into the puppetd sectionLuke Kanies2009-02-281-2/+2
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-2658-205/+205
| | | | | | | | semicolons
* | Fixed metaparameter reference to return strJames Turnbull2009-02-261-1/+11
| |
* | Merge branch 'tickets/master/2016'James Turnbull2009-02-242-36/+38
|\ \
| * | Fixed #2016 - Split metaparameters from types in reference documentationJames Turnbull2009-02-242-36/+38
| | |
* | | Fixed #2017 - incorrect requireJames Turnbull2009-02-241-1/+1
|/ /
* | Fixing #1904 - aliases are no longer inherited by child filesLuke Kanies2009-02-201-1/+1
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2009-02-201-12/+11
|\| | | | | | | | | | | Conflicts: lib/puppet/type/file/content.rb spec/unit/type/file/content.rb
| * Fixing #1871 once and for all - contents are never printedLuke Kanies2009-02-181-8/+11
| | | | | | | | | | | | | | | | | | They were still being printed in noop mode. The fix was to use is_to_s and should_to_s methods, rather than 'change_to_s'. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing or fixing old testsLuke Kanies2009-02-191-2/+2
| | | | | | | | | | | | | | | | Most of these were just obsolete tests that have been sitting around and broke with recent internal changes. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Correctly handling URI escaping throughout the REST processLuke Kanies2009-02-198-36/+14
| | | | | | | | | | | | | | | | | | | | This means, at the least, that we can now serve files via REST when they have spaces and other weird characters in their names. This involves a small change to many files. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring how the Settings file is parsedLuke Kanies2009-02-193-24/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this refactor was to use a cached attribute for the LoadedFile instance we use to monitor whether the file needs reparsing. We were getting tests that affected later tests because they were holding on to LoadedFile stubs, somehow. The other main change here is that the Settings#parse method now knows how to look up its own file path. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Relying on 'should_parse_config' in the 'puppet' applicationLuke Kanies2009-02-191-5/+0
| | | | | | | | | | | | | | | | There was some redundancy here, as the app was marked as needing to parse the config, but then the setup hook manually parsed it. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Providing better indirection authorization errorsLuke Kanies2009-02-192-1/+6
| | | | | | | | | | | | | | The errors now include the indirection and key, or the full URI used. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding pluginsyncing support to the IndirectorLuke Kanies2009-02-1912-365/+302
| | | | | | | | | | | | | | | | | | This switches away from the use of terminii for each type of fileserving - it goes back to the traditional fileserving method, and is much cleaner and simpler as a result. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving Request and Fileset integration into Fileset.Luke Kanies2009-02-192-18/+31
| | | | | | | | | | | | | | It was previously in a helper module, TerminusHelper. I hope to actually remove that module entirely. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Switching the ModuleFiles Indirection terminus to the new Module/Env apiLuke Kanies2009-02-191-3/+3
| | | | | | | | | | | | Again, much cleaner and simpler. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Migrating the old FileServer to the new Module/Environment codeLuke Kanies2009-02-191-12/+13
| | | | | | | | | | | | | | The interface is *much* cleaner, and I'd removed one of the methods used in this code. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Using the Environments to handle a lot of Module searchingLuke Kanies2009-02-181-37/+2
| | | | | | | | | | | | | | | | | | | | Since Environments now know how to look for modules, a lot of the Module code was able to be pushed into them. Also moving some of the tests to instance-level tests, rather than just testing the class-level interfaces. 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>
* | Adding support for finding all modules in a given path.Luke Kanies2009-02-181-0/+22
| | | | | | | | | | | | | | | | This 'each_module' method will be used by environments to find all or a given module, and will likely eventually be used internally, too. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Supporting multiple paths for searching for files.Luke Kanies2009-02-181-3/+7
| | | | | | | | | | | | | | This is, once again, used for plugins, which needs to search across multiple modules' plugin directories. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding support for merging multiple filesets.Luke Kanies2009-02-181-0/+17
| | | | | | | | | | | | | | This is required for plugins, which recurse across multiple directories. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding new methods to Puppet::Module.Luke Kanies2009-02-181-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | There are now boolean methods to test whether a given kind of file is present in a given module. E.g, you can do: Puppet::Module.new("mod", "/my/path").plugins? There are also accessor-style methods that return the full path for a given kind of file. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring Puppet::Module a bit.Luke Kanies2009-02-181-22/+18
| | | | | | | | | | | | | | No behaviour change here, just some internal changes to make way for methods I want to add. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Only using the checksum cache when we're using a host_config catalogLuke Kanies2009-02-181-0/+2
| | | | | | | | | | | | | | | | Only host-configs actually load and store the state file, so any attempt to use that state will just result in lots of "initializing" and "creating" messages. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing fileserving to support strings or symbolsLuke Kanies2009-02-182-1/+2
| | | | | | | | | | | | | | When used internally we would use symbols, but the REST transfers need to support strings. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding clarity to query string handling in REST callsLuke Kanies2009-02-184-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Some small fixes to provide better debugging and load a libraryLuke Kanies2009-02-182-0/+2
| | | | | | | | 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>
* | Move --version handling to Puppet::ApplicationBrice Figureau2009-02-167-34/+16
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Move puppetd to the Application Controller paradigmBrice Figureau2009-02-161-0/+260
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Move puppetdoc to the Application Controller paradigmBrice Figureau2009-02-161-0/+198
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Move ralsh to the Application Controller paradigmBrice Figureau2009-02-161-0/+166
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Move puppetrun to Application Controller paradigmBrice Figureau2009-02-161-0/+221
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Move pi to the Application Controller paradigmBrice Figureau2009-02-161-0/+216
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>