summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2.6.x' into nextMatt Robinson2010-12-0210-11/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#5304) Use internal_name rather than real_name for maillist provider Updated CHANGELOG and version for 2.6.4 Revert "(#5304) Use internal_name rather than real_name for maillist provider" Disable remote ralsh by default (#5424) Ship auth.conf as part of installing from source (#5304) Use internal_name rather than real_name for maillist provider Renamed Reductive to Puppet Manually Resolved Conflicts: lib/puppet/provider/maillist/mailman.rb
| * Renamed Reductive to PuppetJames Turnbull2010-11-2910-11/+11
| | | | | | | | I swear I've done this before. *confused*
* | Merge remote branch 'masterzen/feature/master/4339' into nextPaul Berry2010-11-221-5/+3
|\ \ | | | | | | | | | | | | Manually resolved conflicts: spec/unit/configurer_spec.rb
| * | Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yamlBrice Figureau2010-11-131-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once a configuration run is done, puppetd will save on the node a yaml summary report roughly akin to: --- time: notify: 0.001025 last_run: 1289561427 schedule: 0.00071 config_retrieval: 0.039518 filebucket: 0.000126 resources: changed: 1 total: 8 out_of_sync: 1 events: total: 1 success: 1 changes: total: 1 This is almost an hash version of the current --summarize output, with the notable exception that the time section includes the last run unix timestamp. The whole idea is to be able to monitor locally if a puppetd does its job. For instance this could be used in a nagios check or to send an SNMP trap. The last_run information might help detect staleness, and this summary can also be used for performance monitoring (ie time section). The resource section can also show the number of failed resources. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | | Maint: Added assertion to make sure Log.close_all succeedsPaul Berry2010-11-181-0/+1
| | | | | | | | | | | | | | | | | | If the hash containing log destinations gets corrupted, Log.close_all could fail silently. This change adds an exception to make these failures easier to debug should they ever happen again.
* | | Maint: Switched spec tests to use a class rather than Array as the log ↵Paul Berry2010-11-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | destination. Using an Array as a log destination is unreliable because Puppet's log mechanism stores log destinations in a hash whose key is the destination itself. Since arrays can change their hash when they are modified, this was causing the log destination hash to become corrupted, producing sporadic spec test failures.
* | | Merge commit '2.6.3' into nextPaul Berry2010-11-178-19/+25
|\ \ \ | | |/ | |/| | | | | | | | | | Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
| * | (#4726) Fix RRD legacy supportMatt Robinson2010-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | There was a section of code that didn't take the legacy RRD library into account. This caused a unit test failure, but only if you have the RRD legacy library installed, which I did. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | Fix for #4299 -- Don't require whichMarkus Roberts2010-11-122-9/+2
| | | | | | | | | | | | | | | | | | We already had an internal implementation of which hiding under an assumed name (Puppet::Util.binary); this commit calls it out of hiding and uses it consisantly.
| * | Fix for #4955 -- Race condition & memory leak in Puppet::UtilMarkus Roberts2010-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Puppet::Util.sync method was not thread safe and also leaked memory. I'm not certain, but I believe the first is ironic and the second is merely a bug. This patch addresses the problem by 1) refactoring so the sync objects are never returned (and thus no one can cache a reference to one) 2) adding reference counting 3) deleting them when they are no longer needed 4) doing the thread safty dance. It wasn't the first (or even second) solution considered, but it's the one that I was able to make work in a way that I'm convinced is correct. Its main advantage is that it puts all the tricky bits in one place.
| * | Fix #4923 - close process race when truncating existing fileBrice Figureau2010-11-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using File.open(file, "w") calls open(2) with O_CREAT|O_TRUNC which means when the file exists it is immediately truncated. But the file is not locked yet, so another process can either write or read to the file, leading to file corruption. The fix is to truncate only when the file is exclusively locked. This can be done on some operating system with O_EXLOCK open(2) flag. I chose the more portable option of: * open * flock * truncate * write * close It might also be good to flush and fsync the file after writing it, otherwise in case of crash an incomplete file can stay on disk. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | capture stderr from exec resourcesNigel Kersten2010-11-101-1/+1
| | |
| * | Fix #3808 - puppetdoc should use --force-update only if RDoc supports itBrice Figureau2010-11-101-4/+5
| | | | | | | | | | | | | | | | | | This should allow to run puppetdoc on ruby 1.8.5. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix #4911 - Do not generate doc for standard RDoc parser generated objectBrice Figureau2010-11-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | RDoc has some standard parsers for .c,.cc or fortran files (don't ask why). Unfortunately our html generator doesn't support the data structures generated by those parsers and we were bombing on unknown methods. This patch makes sure we generate html only for our own top level objects. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Kludge for #5206 -- port of fix for #3536 to yamlMarkus Roberts2010-11-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal format of parameters was changed between 0.25.x and 2.6.x, making them incompatible when serialized. This was fixed for PSON under ticket #3656 (by modifying the data as it was serialized) in: commit f66095d35bc5f9645eb19bbb8cefa342c0181d2d and commit 2edf7fe968ac3d8af9865f65100940747c1fa894 but nothing was done about the other serialization formats. This commit adds a callback to zaml property serialization and uses it to route data through the fixup method added in the commits above, thus fixing the problem "the same way" as it was fixed for PSON under #3656. It does nothing about marshal, mostly because I have not totaly gone over to the dark side (yet).
* | | Merge branch 'ticket/next/4590' into nextMarkus Roberts2010-11-171-0/+15
|\ \ \ | |_|/ |/| | | | | | | | | | | Conflicts: lib/puppet/util/monkey_patches.rb -- two unrelated additions had been made, kept them both.
| * | [#4590] SimpleGraph is slowPaul Berry2010-10-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrote SimpleGraph to use a more efficient internal representation. To preserve compatibility with older clients, graphs are still serialized to YAML using the format used by Puppet 2.6. However, a newer, more compact format can be enabled by setting "use_new_yaml_format" to true. Deserialization from YAML accepts either the old 2.6 format or the newer format. In a later release, once we no longer need to be compatible with 2.6, we will be able to switch to the new format. To make deserialization accept multiple formats, it was necessary to use the yaml_initialize method. This method is not supported in versions of Ruby prior to 1.8.3, so a monkey patch is included to add support for it to Ruby 1.8.1 and 1.8.2. Thanks to Markus Roberts for the SimpleGraph rewrite. Thanks to Jesse Wolfe for figuring out how to write the yaml_initialize monkey patch.
* | | Merge commit '2.6.3rc2' into nextPaul Berry2010-11-091-2/+0
|\ \ \ | | |/ | |/| | | | | | | | | | Manually resolved conflicts: lib/puppet/parser/ast/resource.rb spec/unit/parser/ast/resource_spec.rb
| * | Fixed #5137 - Removed no longer required TOC referencesJames Turnbull2010-10-291-2/+0
| | |
* | | maint: prevent fork bombs by disabling ActiveSupport's Kernel.daemonizeJesse Wolfe2010-11-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveSupport provides a "daemonize" method on all objects that causes the ruby process to fork to the background. This is extremely surprising and dangerous, and some of our spec tests could trigger this accidentally. This patch adds a "daemonize" method to Object which shadows the ActiveSupport version, preventing it from ever being called.
* | | Merge commit '2.6.2' into nextJesse Wolfe2010-10-121-1/+1
|\| |
| * | Fixed #4919 - added parenths to fix error message:James Turnbull2010-10-021-1/+1
| | | | | | | | | | | | /usr/lib/ruby/site_ruby/1.8/puppet/util/metric.rb:62: warning: parenthesize argument(s) for future version
* | | Merge commit '2.6.2rc1' into nextJesse Wolfe2010-10-041-1/+0
|\| |
| * | Fix for #4896 -- stray newline left over from removed diagnosticMarkus Roberts2010-09-301-1/+0
| | | | | | | | | | | | | | | A newline that was part of a diagnostic was left in, and this caused problems with the serialization of strings in "preserve newlines" mode.
* | | Partial merge to 2.6.2rc1 : Merge commit '574812e' into nextJesse Wolfe2010-10-041-10/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | The API for AST objects has changed, making the initialization of this spec somewhat more complicated. Also, git seems to have been confused by whitespace changes. Manually Resolved Conflicts: lib/puppet/parser/ast/resource.rb
| * | (#4860) Fix wrong method name.. params seems to be renamed to parametersSimon Effenberg2010-09-281-1/+1
| | |
* | | Partial merge to 2.6.2rc1 : Merge commits 'd057b90' and '6dd1930' into nextJesse Wolfe2010-10-041-9/+38
|\| | | | | | | | | | | | | | This commit merges in d057b90 with the addition of commit 6dd1930 to fix some tests that are confined to machines where rrd is installed.
| * | Fix #4726 Update puppet rrdtool metric code to support modern rrd ruby bindingsJesse Wolfe2010-09-281-9/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | The rrd project has been shipping ruby bindings since 1.3.0, and the old rrdtool ruby library is no longer being maintained. This patch is based upon Davor Ocelic's submitted code, with the addition that I've added conditionals so it can still call the old rrdtool library if a modern rrd is not installed.
* | | Partial merge to 2.6.2rc1 : Merge commit '99c1019' into nextJesse Wolfe2010-10-041-9/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This conflict was a little too complicated for diff to figure out, but the resolution is actually fairly mechanical. Some unit tests changed because they were mocking unnecessarily. Manually Resolved Conflicts: lib/puppet/util/rdoc/parser.rb spec/unit/util/rdoc/parser_spec.rb
| * | [#4798] Puppet doc manifests documentation mode brokenPaul Berry2010-09-221-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running puppet doc, if the directory containing the user's specified manifest file overlaps with the modules directory (i.e. they are the same directory or one contains the other), Puppet doc would try to parse the overlapping files twice, triggering an exception which made the documentation run fail. Fixed the bug by adding a check to the RDoc::Parser#scan method to prevent re-parsing of files that have already been parsed. Also added a spec test to verify that this works.
* | | Partial merge to 2.6.2rc1 : Merge commit '7b8cb74' into nextJesse Wolfe2010-10-021-4/+4
|\| | | | | | | | | | | There are merge conflicts with commits following this one.
| * | Fixed Puppet Doc TOC generationJames Turnbull2010-09-161-2/+2
| | |
| * | Documentation updates for Markdown conversionJames Turnbull2010-09-141-2/+2
| | |
* | | Merge remote branch 'paul/ticket/next/4570' into nextJesse Wolfe2010-09-081-12/+11
|\ \ \ | |_|/ |/| |
| * | Fixed issue #4570 (Race conditions when serializing objects to YAML).Paul Berry2010-08-231-12/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The ZAML class was using class variables to keep track of labels and backreferences while serializing object to YAML. This made it possible to get ill-formed or incorrect YAML output if two threads tried to serialize objects at the same time. Changed to use instance variables of the ZAML class, so there is no race condition. Also added some more spec tests to verify that labels are generated properly.
* | Merge remote branch 'paul/4472-4483-4496-4521-4522'Jesse Wolfe2010-08-171-5/+9
|\ \ | |/ |/| | | a.k.a. "make_taller_trees"
| * [#4496]+[#4521]+[#4522] Add structures to the AST to represent type ↵Paul Berry2010-08-131-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definitions (classes, definitions, and nodes). Previously, type definitions were not represented directly in the AST. Instead, the parser would instantiate types and insert them into known_resource_types as soon as they were parsed. This made it difficult to distinguish which types had come from the file that was just parsed and which types had been loaded previously, which led to bug 4496. A side-effect of this change is that the user is no longer allowed to define types inside of conditional constructs (such as if/else). This was allowed before but had unexpected semantics (bugs 4521 and 4522). It is still possible, however, to place an "include" statement inside a conditional construct, and have that "include" statement trigger the autoloading of a file that instantiates types.
* | Further RST to Markdown fixes for types, values, testsJames Turnbull2010-08-124-46/+19
| |
* | Updated all types to Markdown outputJames Turnbull2010-08-111-5/+4
| | | | | | | | | | | | | | | | | | | | Updated defaults.rb to Markdown Migrated report documentation to Markdown Migrated Naginator doco to Markdown Updated provider documentation to Markdown
* | Updated reference output to generate valid MarkdownJames Turnbull2010-08-113-15/+9
| |
* | Removed legacy Trac codeJames Turnbull2010-08-111-24/+1
| |
* | Fix for #4476 -- rails calling yaml internalsMarkus Roberts2010-08-061-1/+1
| | | | | | | | | | | | | | | | Some recent versions of rails have started calling yaml with the internal (and IIRC depricated) signature; this does nothing special in yaml but it breaks with zaml, so we add an ignored parameter to simulate the non-behavior. *sigh* I love rails.
* | Fix #4461 - attempt to fix another performance issueBrice Figureau2010-08-031-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a profiling of a 2.6.1rc1 puppet master, I found that we spend a lot of time and efforts in Puppet::Util::Autoload#module_directories. Since this method is doing a bunch of filesystem access, this process is slow. In fact each time we were evaluating a resource or trying to find if a given resource was a builtin type we ended up scanning the whole module directories for the given environment. This patch attempts to fix this performance issue by caching the module_directories output for the either the time of the compilation or an agent configurer run (since this stuff looks like to be shared for both compilation and catalog evaluation). With this patch, my compilation time for 2k resources went from 5.91s to 3.71s (second run each time to allievate parsing time).. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com> Edited to fix a typo [#4434] Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* | Removed eventual documentation line ... eventually cameJames Turnbull2010-07-301-2/+0
|/
* Fix #4244 - Cached Attributes is not thread safeBrice Figureau2010-07-251-10/+15
| | | | | | | | | | The underlying hash is not protected and thus two threads accessing the cached value at the same time and one expiring the value can result in a race condition. This patch synchronizes the access to the value_cache underlying hash. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* JRuby doesn't implement Process.maxgroupsBrice Figureau2010-07-251-1/+4
| | | | | | So let's not call it :) Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #4348 - Puppet doc single manifest brokenBrice Figureau2010-07-251-1/+1
| | | | | | | | The refactoring of using environment instances instead of strings for initializing the parser, rdoc wasn't updated, thus was unable to initialize the parser. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #4286 - rename puppetdoc global module <site> to __site__Brice Figureau2010-07-251-3/+5
| | | | | | | | | < and > might be invalid or borderline chars to use for a file name or an url. This patch changes those characters to __. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing #4268 - manifests always importedLuke Kanies2010-07-191-15/+6
| | | | | | | | | | | | | | The problem is that the environment list gets cleared when Settings#set_value is called, and it was being called every time Settings#use was called, which is more often than obvious but especially if reporting is enabled. Previously we ignored noop when running inside of Settings, and this essentially adds that back in, so we can remove the special noop behaviour in Settings itself. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixes errant Trac references in documentationJames Turnbull2010-07-156-6/+6
|