summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util/settings.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fixing #3148 Settings#without_noop when run with no noop settingLuke Kanies2010-02-171-3/+2
| | | | | | | Some tests didn't define this setting which caused this method to fail. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Merge branch '0.25.x'James Turnbull2010-01-131-25/+30
|\ | | | | | | | | | | Conflicts: lib/puppet/ssl/host.rb spec/spec_helper.rb
| * Fix for #2657 (retain old setting if config has syntax error)Markus Roberts2009-12-201-25/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This appears to be regression introduced by threading changes. The fix was to rearrange things to keep the old behaviour (don't clear the settings until you know the config file parses) and the new (don't nest calls to synchronize) by: 1. Splitting clear into two parts--clear, which works as before, and unsafe_clear which it calls and which expects synchronization to be handled externally. 2. Rearranging the code to recover the previous calling order 3. Trapping syntax errors and turning them into logged messages and a no-op effect. 4. Fixing reparse to not wrap a call to this code with a synchronize. 5. Tests. Signed-off-by: Markus Roberts <Markus@reality.com>
* | Fix #2649 Allow ssl dir creation in --noop modeRein Henrichs2009-11-191-1/+9
|/ | | | | | | | Wrap Puppet::Settings.use in a block that disables noop mode during the execution of the block and ensures that noop returns to its original value afterwards. This allows internal puppet catalog operations like ssl directory creation to occur even when puppet is run in --noop mode. This should actually solve a broader class of related bugs.
* Bug #1900 Parsing of quoted $ in stdinJesse Wolfe2009-10-191-16/+25
| | | | | | | | | | | | | | | When code comes in via STDIN or --code , Puppet::Util::Settings interpolates $values in the code, which is probably never the intended behavior. This is the least destructive fix I could think of: have Puppet::Parser::Interpreter ask for the uninterpolated value. More general fixes could be to: a) Add an escape character to Settings's interpolator, and escape STDIN b) Add a mechanism to Settings to mark some values as uninterpolated Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fixing #2590 - modulepath is not cached inappropriatelyLuke Kanies2009-09-031-0/+8
| | | | | | | | | | | | | | | | It was getting cached by Environment instances too early, thus causing some executables to use the default even when it was overridden. We're taking the slightly extreme step of clearing the environment list if any parameter is set, but this is relatively inexpensive and is the only way to always be correct. The reason that the environments cache this value at all is that to build up their module path they have to search through every known module for a lib or plugins directory, which is then done every time a class is sought in the language. Caching it saves a *ton* of file accesses. Signed-off-by: Luke Kanies <luke@madstop.com>
* Not using the service user in settings when it's unavailableLuke Kanies2009-08-241-0/+10
| | | | | | | | | This gets us most of the way toward fixing #2460 - we can now have the certificate information owned by the service user when it's available, thus making it so that puppetmasterd (not running as root) can read it. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving Setting classes into separate filesLuke Kanies2009-08-241-277/+39
| | | | | | | | This isn't really a refactor, just moving code around. I did some simple method renaming, also. Signed-off-by: Luke Kanies <luke@madstop.com>
* 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>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-5/+5
|
* Fixing a bunch of warningsLuke Kanies2009-06-031-2/+0
| | | | | | This commit should have no functional effect. 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>
* 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>
* Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-261-12/+12
| | | | semicolons
* Fixed #2017 - incorrect requireJames Turnbull2009-02-241-1/+1
|
* 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>
* 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>
* Canonicalizing Setting section names to symbols.Luke Kanies2008-12-181-14/+14
| | | | | | | | | I thought I was already using symbols everywhere so it didn't matter, but there are a few places (e.g., the process name) where they were strings, and that made things not work so much. Signed-off-by: Luke Kanies <luke@madstop.com>
* Finishing the work to use Puppet::Resource instead of TransObjectLuke Kanies2008-12-181-9/+16
| | | | | | | | | | | | This was a complicated project because TransObject had made its way into too many classes. The usage by Util::Settings was particularly nefarious. Refactoring and fixing this exposed some other issues. The main complication, though, was the extent to which the Puppet::Type class depended on TransObject. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Settings class to use Puppet::ResourceLuke Kanies2008-12-181-174/+69
| | | | | | | It also now uses the Catalog instead of the recursive TransObject stuff. Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2008-12-021-74/+80
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Refactoring the thread-safety in Puppet::Util a bit.Luke Kanies2008-11-261-21/+27
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixing #1683 - accessing and changing settings is now thread-safe.Luke Kanies2008-11-261-140/+144
| | | | | | | | | | | | Applying patch by Matt Palmer. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,Luke Kanies2008-10-171-3/+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
| * Fixed #1613 - The client environment will be substituted when looking up ↵Luke Kanies2008-10-031-3/+5
| | | | | | | | | | | | | | | | | | | | settings. This won't be perfect, because it still requires that the caller pass in an environment, but for every case that an environment is passed in, that environment will be substituted into settings when possible. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-08-201-4/+0
|\|
| * Removed reference to namespaces from --genconfig documentationJames Turnbull2008-08-211-4/+0
| |
* | Merge branch '0.24.x'Luke Kanies2008-07-041-7/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/util/settings.rb spec/integration/defaults.rb spec/unit/node/catalog.rb spec/unit/type/interface.rb spec/unit/type/ssh_authorized_key.rb
| * Fixed #1231 - Exceptions during startup should now be clear.Luke Kanies2008-07-041-2/+4
| | | | | | | | | | | | | | This will often result in duplicate information, but at least the information will now always be there. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-07-021-0/+58
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: CHANGELOG spec/unit/node/catalog.rb spec/unit/type/package.rb spec/unit/type/schedule.rb spec/unit/type/service.rb spec/unit/util/settings.rb
| * issue 1183Andrew Shafer2008-06-161-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added environment awareness to --configprint Pulled the logic for --configprint --genconfig and --genmanifest out of puppet.rb Put the logic in lib/puppet/util/settings.rb and refactored it a bit Added specs for the behavior Reformated the whole spec file to use nested describe Added the new method to the executables The old behavior should be preserved, except for the env is now used
* | Merge branch '0.24.x'Luke Kanies2008-05-201-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: CHANGELOG spec/integration/defaults.rb spec/integration/node/catalog.rb spec/unit/rails.rb spec/unit/type/mount.rb
| * Fix for ticket #1218 - changed to appropriate variable nameJames Turnbull2008-05-101-1/+1
| |
* | The master and client now successfully speak xmlrpc using the new system.Luke Kanies2008-05-071-3/+9
| | | | | | | | | | | | The server is actually serving REST, but the client can't use it until we resolve the format and security issues that REST hasn't yet tackled.
* | The Settings class now clears the 'used' sections when a value is changed.Luke Kanies2008-05-051-1/+3
| | | | | | | | | | | | | | | | | | This makes is so that if you, for instance, reset the vardir, then the next time an initialization call is made, we reuse any previously used sections, thus (hopefully) correctly creating any newly needed directories. This is mostly helpful during testing.
* | I think I've now got the Webrick SSL support working.Luke Kanies2008-04-281-1/+6
| | | | | | | | | | Now I just need to get xmlrpc working alongside REST in both mongrel and webrick.
* | We have a basically functional CA -- it can signLuke Kanies2008-04-151-1/+1
| | | | | | | | | | | | requests and return certificates. There's still plenty more work to do, but I'm probably not much more than a day away from redoing puppetca to use this code.
* | Fixing tests that were failing as a result of the merge,Luke Kanies2008-04-011-4/+0
| | | | | | | | | | including removing some now-obsolete code and tests from the Settings class.
* | Merge branch '0.24.x'Luke Kanies2008-03-201-23/+26
|\|
| * Refactoring how the catalog creation handles errors.Luke Kanies2008-03-181-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if there were an error creating a resource, the error would propagate leaving any previously created resources still in memory. Now, resources are removed by default when an error happens during instantiation, and the error propagates to the caller so that they can log or whatever. This also allows the Settings class to correctly and separately handle the cases where we can't create the catalog (which should never happen in normal usage but was happening because of this error -- later catalogs couldn't be created because earlier catalogs left resources lying around) from those where we can't apply the catalog.
| * Removing extra debuggingLuke Kanies2008-03-181-1/+0
| |
| * Settings now (again?) do not use a section more thanLuke Kanies2008-03-181-8/+13
| | | | | | | | once, which should make the system a bit more efficient.
| * Hopefully *finally* fixed the "already being managed" problemLuke Kanies2008-03-181-6/+9
| | | | | | | | | | | | (#1036). The problem only cropped up if there was a failure when trying to manage the system -- this would cause the setting-based resources not to get cleaned up.
* | Merge branch '0.24.x'Luke Kanies2008-03-071-47/+49
|\|
| * Changed name of method for clarity per code reviewLuke Kanies2008-03-051-5/+5
| |
| * Ticket #1041Andrew Shafer2008-03-051-47/+49
| | | | | | | | | | | | | | | | | | | | The CA serial file was getting owned by root because it was using a different method to write to file Pulled the readwritelock out of lib/puppet/sslcertificates/ca.rb into lib/puppet/util/settings.rb Refactored write, writesub and readwritelock a bit to reuse code (write and readwritelock both call writesub) Added a mode to :serial in lib/puppet/util/defaults.rb
* | Merge branch '0.24.x'Luke Kanies2008-02-251-1/+1
|\|
| * Somewhat refactored fileserving so that it no longer cachesLuke Kanies2008-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | any objects, nor does it use Puppet's RAL resources. In the process, I fixed #894 (you can now copy links) and refactored other classes as necessary. Mostly it was fixing tests. This is a squashed commit of a temporary branch, fwiw, and it also includes any fixes to the tests that were necessary to get all tests passing again.
* | Merge branch '0.24.x'Luke Kanies2008-02-121-16/+19
|\| | | | | | | | | | | Conflicts: CHANGELOG