summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix #2439 - let puppetdoc use loaded_codeBrice Figureau2009-07-241-3/+3
| | | | | | | | Since there isn't any unit test for puppetdoc rdoc code (my fault), nobody noticed it was using direct access to the parser AST array. This changeset fixes the way puppetdoc uses the parser results. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #1963 - Failing to read /proc/mounts for selinux kills file downloadsRicky Zhou2009-07-161-2/+8
| | | | | This works around a linux kernel bug that causes a select() on /proc/mounts to hang.
* Ruby no longer clobbers puppet autoloadingLuke Kanies2009-07-161-0/+1
| | | | | | | | | We basically just make sure that we tell Ruby about files we've loaded, so you can 'require' these files and doing so will essentially no-op, rather than clobbering the already-loaded code. Signed-off-by: Luke Kanies <luke@madstop.com>
* Added Markdown mode to puppetdoc to output Markdown.James Turnbull2009-07-101-5/+27
| | | | Requires the pandoc binary to function (http://johnmacfarlane.net/pandoc/).
* Allow boolean value for boolean cli parameterBrice Figureau2009-07-101-0/+2
| | | | | | | | This is to fix puppetdoc boolean parameters. Puppetdoc defers sending parameters to Puppet::Util::Setting, and in this case, boolean parameters are stored as a boolean value. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2366 - puppetdoc was parsing classes in the wrong orderBrice Figureau2009-07-101-1/+2
| | | | | | | | | | | | It could happend that we were generating doc for subclasses before classes, in which case we were forgotting some parent class instance and recreating them. We ended up generating doc for some classes multiple times, from which some were missing documentation. The fix is to sort the parsed classes alphabetically, which auto- matically puts enclosing class before enclosed classes. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Adding a JSON utility module for providing Ruby compatLuke Kanies2009-06-061-0/+13
| | | | | | | This provides the class-method behaviour that Ruby's JSON support expects but that we don't provide. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-0624-84/+84
|
* Changed tabs to spaces without interfering with indentation or alignmentIan Taylor2009-06-062-74/+74
|
* Fixing a bunch of warningsLuke Kanies2009-06-032-3/+1
| | | | | | This commit should have no functional effect. Signed-off-by: Luke Kanies <luke@madstop.com>
* Using Message acknowledgement in queueingLuke Kanies2009-06-031-1/+4
| | | | | | | | | This allows a more fine-grained load-balancing of the queue, which makes it easy to spin up multiple puppetqd instances and process the queues faster. Signed-off-by: Luke Kanies <luke@madstop.com>
* Changing Puppet::Cacher::Expirer#expired? method nameLuke Kanies2009-05-281-2/+2
| | | | | | | | | This method name clashed with Puppet::Indirector::Envelope#expired?, and its name wasn't actually very appropriate. The new method name is 'dependent_data_expired?'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2288 - fixing the tests broken by my attr_ttl codeLuke Kanies2009-05-221-0/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Caching whether named autoloaded files are missingLuke Kanies2009-05-202-2/+18
| | | | | | | | This is the big win, because it causes us to just skip the whole loading infrastructure, including skipping looking through the modulepath. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding caching of file metadata to the autoloaderLuke Kanies2009-05-202-1/+101
| | | | | | | | | | | The cache isn't actually used yet - this just adds all of the plumbing. It was found that stat'ing files that didn't exist could take up to 85% of a run, so this is progress toward getting rid of those stats. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding modulepath caching to the AutoloaderLuke Kanies2009-05-201-17/+22
| | | | | | | | | There's more caching to add, but this simplifies the interface to the list of paths and then caches that list so we aren't constantly searching the filesystem. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding TTL support to attribute cachingLuke Kanies2009-05-201-4/+34
| | | | | | | | | Previously you had to have an Expirer, but now you can declare a TTL for a cached attribute and it will be expired automatically when the cached value is older than the ttl. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #2666 - Broken docstring formattingJames Turnbull2009-05-201-3/+9
|
* Protecting Stomp client against internal failuresLuke Kanies2009-05-181-1/+5
| | | | | | | | Apparently the stomp client is really unhelpful with failures; this attempts to provide at least a bit more information. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the stomp client and tests a bitLuke Kanies2009-05-181-2/+12
| | | | | | | | | | | | | The main goal of this refactor is to tell the client to be resilient to failures (configured at initialization time), and to send all messages as persistent messages (configured for each message). In the process, the client now parses the queue source URI and handles each argument separately. The tests are more thorough, also. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2183 - checksum buffer size is now 4096bLuke Kanies2009-04-241-1/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Modifying the Settings#handlearg prototypeLuke Kanies2009-04-251-2/+2
| | | | | | | | I'd made the argument no longer optional because I thought the method was rarely used, but it's used in puppetd a good bit. Signed-off-by: Luke Kanies <luke@madstop.com>
* Using a setting for configuring queueingLuke Kanies2009-04-221-10/+4
| | | | | | | Removing class methods and such, and switching to relying solely on a setting for the queue configuration. Signed-off-by: Luke Kanies <luke@madstop.com>
* Introduce queue client "plugin" namespace and interface, with a Stomp client ↵Ethan Rowe2009-04-222-0/+132
| | | | | | | | | | | implementation. Puppet::Util::Queue provides queue client mix-in behaviors that enable easy queue client management for consumer classes. Some relevant behaviors include: * standard Puppet instance loader behavior for loading queue client modules on-demand based on the client module specified by symbolic name * singleton registry of known queue client types (based on symbol-to-class mappings from the instance loading behavior) * simple interface for working with an actual queue client instance Puppet::Util::Queue::Stomp wraps the Stomp::Client class to provide an initial queue client option supporting the Stomp messaging protocol. This defines the interface for all Puppet queue client plugins going forward.
* Initial implementation of a "cache accumulator" behavior.Ethan Rowe2009-04-221-0/+65
| | | | | | | | | | | | | Mix Puppet::Util::CacheAccumulator into an ActiveRecord-like class, and then for any attribute in that class on which you are likely to call find_or_create_by_*, specify: accumulates :foo and instead of :find_or_create_by_foo use :accumulate_by_foo. The class will cache known results keyed by values of :foo. Do an initial bulk-lookup: class.accumulate_by_foo('foo1', 'foo2', 'foo3', 'foo4')
* Changing rails value serialization to deal with booleansLuke Kanies2009-04-221-3/+17
| | | | | | | | The database was automatically converting booleans to strings, and value comparison was not working correctly as a result. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Rails integrationLuke Kanies2009-04-221-39/+0
| | | | | | | | This moves all code from the Parser class into the ActiveRecord classes, and gets rid of 'ar_hash_merge'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a common Settings method for setting valuesLuke Kanies2009-04-221-34/+34
| | | | | | | | We were previously missing some hooks for settings set via the command-line, because different code paths were being used. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing all tests that were apparently broken in the 0.24.x merge.Luke Kanies2009-04-021-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2009-04-021-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/ralsh lib/puppet/executables/client/certhandler.rb lib/puppet/parser/functions/versioncmp.rb lib/puppet/parser/resource/reference.rb lib/puppet/provider/augeas/augeas.rb lib/puppet/provider/nameservice/directoryservice.rb lib/puppet/provider/ssh_authorized_key/parsed.rb lib/puppet/type.rb lib/puppet/type/file/checksum.rb spec/integration/defaults.rb spec/integration/transaction/report.rb spec/unit/executables/client/certhandler.rb spec/unit/indirector/ssl_rsa/file.rb spec/unit/node/catalog.rb spec/unit/provider/augeas/augeas.rb spec/unit/rails.rb spec/unit/type/ssh_authorized_key.rb spec/unit/type/tidy.rb test/executables/filebucket.rb test/executables/puppetbin.rb
| * Fix #1807 - make Puppet::Util::Package.versioncmp a module functionBrice Figureau2009-03-241-0/+2
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fixed #1963 - Failing to read /proc/mounts for selinux kills file downloadsJames Turnbull2009-02-281-1/+3
| |
* | Removing an unused source fileLuke Kanies2009-03-201-59/+0
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-265-26/+26
| | | | | | | | semicolons
* | Fixed #2017 - incorrect requireJames Turnbull2009-02-241-1/+1
| |
* | Correctly handling URI escaping throughout the REST processLuke Kanies2009-02-191-22/+0
| | | | | | | | | | | | | | | | | | | | 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-191-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Introducing the Application ControllerBrice Figureau2009-02-161-0/+28
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Merge branch '0.24.x'Luke Kanies2009-02-141-5/+5
|\| | | | | | | | | Conflicts: test/ral/manager/type.rb
| * Only backing up within parsedfile when managing filesLuke Kanies2009-02-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | I was getting failing tests because I was using non-files for testing and they didn't back up the same, not surprisingly. This moves the 'backup' method to the :flat filetype and then only backs up if the filetype supports it. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2009-02-132-97/+5
|\| | | | | | | | | | | | | | | | | | | 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 #1541 - ParsedFile only backs up files once per transactionLuke Kanies2009-02-131-1/+0
| | | | | | | | | | | | | | | | This moves responsibility for backups from the filetype to the consumer of the filetype, but only ParsedFile actually uses filetypes. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Removing the apparently obsolete netinfo filetype.Luke Kanies2009-02-131-88/+0
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Migrated FileType tests to spec, and fleshed them out a bit.Luke Kanies2009-02-131-3/+3
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixing #1869 - autoloaded files should never leak exceptionsLuke Kanies2009-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Ruby's exception hierarchy is a bit strange, in that only exceptions that sub RuntimeError are caught by default. This patch explicitly catches the base class, Exception, which means that LoadError, SyntaxError, and any RuntimeErrors will all be caught. This is done for both load() and loadall(); load() uses Kernel.load, but loadall() uses Kernel.require. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2009-02-112-0/+5
|\| | | | | | | | | | | Conflicts: CHANGELOG spec/unit/type/file/selinux.rb
| * Fixed #1538 - Yumrepo sets permissions wrongly on files in /etc/yum.repos.dJames Turnbull2009-02-111-0/+1
| |
| * Prefetching, and thus purging, Nagios resources now worksLuke Kanies2009-02-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | *only* if you use the default configuration file locations. In the end, this was a relatively minor change; most of the actual diff centers around making the code more readable so I could think my way into the fix, and adding tests for cases that were either untested or refactored slightly. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Rails serialization module to help serialize/unserialize some Puppet ObjectsBrice Figureau2009-02-061-0/+18
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Creating and using a new Puppet::Daemon classLuke Kanies2009-02-061-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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>