summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving
Commit message (Collapse)AuthorAgeFilesLines
* Add master side file content streamingBrice Figureau2010-02-171-3/+4
| | | | | | | | | This patch allows the puppetmaster to serve file chunks by chunks without ever reading the file content in RAM. This allows serving large files directly with the master without impacting the master memory footprint. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2929 - Allow checksum to be "none"Brice Figureau2010-02-172-2/+3
| | | | | | | | | | | | | | | | File checksum is "md5" by default. When managing local files (not sourced or content) it might be desirable to not checksum files, especially when managing deep hierarchies containing many files. This patch allows to write such manifests: file { "/path/to/deep/hierarchy": owner => brice, recurse => true, checksum => none } Then puppet(d) won't checksum those files, just manage their ownership. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Uncommeniting the fix for #3001Markus Roberts2010-01-211-1/+1
|
* Minimal fix for #3001 (failing to fetch metadata on dangling symlink)Markus Roberts2010-01-191-1/+1
| | | | | | | FileTest.exists? returns false if the target of a symlink is missing; in such cases we still want to continue if the resource is a symlink, as we may be managing a dangling symlink. Continuing in such case either gives the desired behavior or a more specific/informative error message.
* Partial rollback of refinements to fix for #2994Markus Roberts2010-01-021-3/+3
| | | | | | | | | | | | | | The fix for #2994 had been refined to only checksum links when @links was set to :follow to make the tests pass, but this caused partial reintroduction of the original issue since information about the source (the real file vs. followed link distinction) isn't available client side and thus there are paths on which @links winds up :managed when it had originally been :followed. In these cases the checksum is needed but not produced. Consequently, this patch relaxes the condition, and always tries to produce a checksum, with a rescue guard to gracefully handle cases where this is not possible (e.g. broken links).
* Additional fix for #2994 (followed symlinks do not have checksums)Markus Roberts2010-01-011-6/+4
| | | | | | | | | | The first patch for #2994, to which this is an extension, exposed the fact that checksums were not being included in the metadata for followed links; checksums are needed for managing the contents of files that are represented on the server as links (links => follow). This patch adds checksums for followed links and tests to confirm that it works as expected.
* Fixing 2725 Error message when permissions incorrect on file server directoryJesse Wolfe2009-12-021-1/+4
| | | | | | | No message was being displayed on the server if a file could not be opened by the file server. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Possible workaround for #2824 (MRI GC bug)Markus Roberts2009-11-191-1/+1
| | | | | | | | | | | | | | | | | | | This is a moderately ugly workaround for the MRI garbage collection bug (see the ticket for details). I explored several other potential solutions (notably, monkey patching the routines that trigger the bug) but none of them were satisfactory. Monkey patching sub, gsub, sub!, gsub!, etc., for example, either changes the scoping of $~, $1, etc. in a way that could potentially subtly change the meaning of programs or (if you are clever) faithfully reproduces the behaviour of MRI--including the memory leak. I decided to go with the standardized and somewhat obnoxious never- used optional argument as it was easy to automatically insert and should be even easier to automatically find and remove if a better fix is developed. It also should be obtrusive enough to escape accidental removal in refactoring.
* Fix #2757 & CSR 92 (symlinks in recursively managed dirs)Markus Roberts2009-11-052-3/+57
| | | | | | | | | | | | | | | | | | The fundemental problem was that, despite what the comment said, the early bailout for file content management only applied to directories, not to links. Making links bail out at as well fixed the problem for most users. However, it would still occur for users with mixed ruby version system since there were no to_/from_pson methods for file metadata. So the second (and far larger) part of this patch adds metadata pson support. The testing is unit level only, as there's no pratical way to do the cross-ruby-version acceptance testing and no benifit to doing "integration" testing short of that. Signed-off-by: Markus Roberts <Markus@reductivelabs.com>
* Fix #2753 - Do not "global allow" plugins/modules mount if some rules have ↵Brice Figureau2009-10-271-2/+2
| | | | | | | | | | | | | | been parsed When fixing #2424, we were adding a global allow (ie allow(*)) to the plugins/modules mount. Unfortunately global allow always win against any other rules that can be defined in fileserver.conf. This patch makes sure we add those global allow entries only if we didn't get any rules from fileserver.conf Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing #2577 - clarifying and demoting the deprecation noticeLuke Kanies2009-09-011-1/+1
| | | | | | | It's now just notice instead of a warning, and it clarifies that 0.24 clients can't be present. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2558 - propagating recent fileserving changesLuke Kanies2009-08-244-16/+16
| | | | | | | | | | | | | | | | | | I'd made changes to the internals of the fileserving system to fix #2544 (mostly switched from passing the node around and then calculating the environment to just passing the environment around), but those changes weren't consistent throughout the fileserving code. In the process of making them consistent, I realized that the plain file server actually needs the node name rather than the environment, so I switched to passing the request around, because it has both pieces of information. Also added further integration tests which will hopefully keep this from cropping up again. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1544 - plugins in modules now works againLuke Kanies2009-08-182-13/+4
| | | | | | | | | | | | 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>
* Fix #2424 - take 2, make sure default mounts allow every clientsBrice Figureau2009-07-211-0/+2
| | | | | | | | If there isn't any default mounts for plugins/modules, puppet auto creates them. The issue is that they don't have any authorization attached, so they default to deny all. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2424 - File server can't find module in environmentBrice Figureau2009-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Actually, the issue is: * when the web server gets the request, it creates an indirection request, filling attributes like ip or node from the HTTP request. To do this, all the interesting attributes are given in a hash (called options, see P::I::Request#new). Once the request is properly initialized the options hash doesn't contain the ip or node information (see set_attributes) * the request is then transmitted to the file_serving layer, which happily wants to use the node attribute to find environments or perform authorization. Unfortunately it fetches the node value from the request options hash, not the request itself. Since this node information is empty, puppet fails to find the proper mount point, and fails the download. This change makes sure we pass all the way down the node and fix the authorization check. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix small typo in the fix for #2394Brice Figureau2009-07-181-1/+1
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #2394 - warn once on module mount deprecation.Sam Livingston-Gray2009-07-131-1/+1
| | | | Signed-off-by: Sam Livingston-Gray <geeksam@gmail.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-066-9/+9
|
* Modules now can find their own pathsLuke Kanies2009-05-151-1/+1
| | | | | | | | | | | | 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>
* Fix #2101 - fix recurselimit == 0 bad behaviourBrice Figureau2009-03-271-2/+2
| | | | | | | After the fix for #1469, recurselimit = 0 was considered as an infinite recursion which is the reverse of what it was before. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1469 - Add an option to recurse only on remote sideBrice Figureau2009-03-201-13/+7
| | | | | | | | | | | | | | | | | | | When using recurse and a source, if the client side has many files it can take a lot of CPU/memory to checksum the whole client hierarchy. The idea is that it is not necessary to recurse on the client side if all we want is to manage the files that are sourced from the server. This changeset adds the "remote" recurse value which prevents recursing on the client side when a source is present. Since it also is necessary to limit the remote side recursion a new File{} parameter has been added called "recurselimit". Moreover, the Filetset API is changing to allow the new recurselimit parameter, and passing the recursion depth limit in the recurse parameter as an integer is now deprecated and not supported anymore. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.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>
* Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-262-12/+12
| | | | semicolons
* Correctly handling URI escaping throughout the REST processLuke Kanies2009-02-191-5/+1
| | | | | | | | | | 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>
* Adding pluginsyncing support to the IndirectorLuke Kanies2009-02-197-237/+268
| | | | | | | | | 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>
* 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>
* 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>
* Refactoring the Cacher interface to always require attribute declaration.Luke Kanies2008-11-112-6/+10
| | | | | | | | | | | | | | | 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>
* Deduplicating slashes in the fileserving codeLuke Kanies2008-11-041-2/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,Luke Kanies2008-10-172-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix metadata class for cases when checksum_type setPaul Nasrat2008-09-301-3/+3
| |
| * Fix ticket 1596 in new fileset code, use tmpdir in fileserver tests.Paul Nasrat2008-09-301-1/+1
| |
| * Make fileserver use fileset for recursion and handle dangling links by ↵Paul Nasrat2008-09-301-1/+1
| | | | | | | | ignoring them fixing #1544
* | Fixing filesets to allow nil ignore values.Luke Kanies2008-08-281-0/+2
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing FileServing::Base so that it can recurse on a single file.Luke Kanies2008-08-271-1/+1
| | | | | | | | | | | | | | It was throwing exceptions if you tried to use it on a file instead of a directory. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing the terminus helper so it correctly catches options passed from ↵Luke Kanies2008-08-261-1/+10
| | | | | | | | | | | | clients via REST. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding a "source" attribute to fileserving instances.Luke Kanies2008-08-261-0/+4
| | | | | | | | | | | | | | This will be used to cache the source that was used to retrieve the instance. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding automatic attribute collection to the new fileserving code.Luke Kanies2008-08-264-2/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Adding the content writer to the content class.Luke Kanies2008-08-261-1/+3
| | | | | | | | | | | | | | Also choosing a fully qualified fake name when creating content instances from raw content. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing the rest backends for webrick and mongrel so the get the whole ↵Luke Kanies2008-08-261-1/+15
| | | | | | | | | | | | | | | | | | request key. Also adding the Content work necessary to demonstrate that this is actually required. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring how files in FileServing are named.Luke Kanies2008-08-263-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, they retained some concept of the URI used to find them, and this uri was the primary key for the FileServing instances. This key was unfortunately completely useless, as evidenced by the fact that it was never used except to test that it worked. I've modified the FileServing instances (through modifying the Base class) to use their local path as their key, and they no longer care about the URI at all. This commit is mostly about fixing the code that interacts with the instances to use this new API. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Finishing the rename of FileBase => Base.Luke Kanies2008-08-261-0/+76
| | | | | | | | | | | | | | | | | | | | | | Git did something really strange, in that it apparently didn't add the new base.rb files even though I used 'git mv'. Also fixing some other failing tests I hadn't previously tracked down because of the magical tuple of autotest's suckiness and my laziness. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Renaming FileServing::FileBase to FileServing::Base.Luke Kanies2008-08-263-83/+14
| | | | | | | | | | | | | | | | Also fixing a set of tests I broke last night. I'm looking at replacing autotest with rspactor, because my FSEvents hack to autotest means it's harder for me to rerun autotest. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing the yaml conversion code from FileContent.Luke Kanies2008-08-261-8/+0
| | | | | | | | | | | | | | | | Also fixing some integration tests that were failing because of the change to the terminus selection code for file serving. Signed-off-by: Luke Kanies <luke@madstop.com>
* | FileServing Configurations now expect unqualified files.Luke Kanies2008-08-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | This fits in with the fact that the indirection requests split URIs and set the request key to an unqualified path rather than a fully-qualified path. The whole system is unqualified end-to-end, now, except when you're specifically asking for a full, local file name. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing the fileserving terminus selection hook.Luke Kanies2008-08-261-22/+23
| | | | | | | | | | | | | | It now uses the fact that the indirection request does URI parsing, rather than doing the parsing on its own. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x' into mergingLuke Kanies2008-07-291-4/+4
|\| | | | | | | | | | | Conflicts: test/ral/type/filesources.rb
| * Fixed all of the fileserving termini so they use indirection requests.Luke Kanies2008-07-181-4/+4
| | | | | | | | | | | | | | | | This looks like a much larger commit than it is -- it doesn't change any behaviour at all, it just adds some integration tests (which expose the problem) and then switches from an ad-hoc api to a request-based api. Signed-off-by: Luke Kanies <luke@madstop.com>