summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'ticket/next/5375' into nextPaul Berry2010-11-232-23/+6
|\
| * (#5375) Rework puppet apply to use configurer.runPaul Berry2010-11-232-23/+6
| | | | | | | | | | | | | | Puppet apply used to contain code that duplicated the functionality of configurer.run. Refactored to share code. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | (#2866) yum should support downgrade.Dan Bode2010-11-231-1/+8
|/ | | | | | | | | | patch originally from Grzegorz Nosek with contributions on the test from Oliver Hookins. checks if the current version is greater than the should version, if so, calls yum downgrade. Reviewed-by: Matt Robinson
* Merge branch 'ticket/2.6.x/5261' into nextJesse Wolfe2010-11-221-22/+1
|\
| * Fix #5261 Don't escape Unicode characters in PSONJesse Wolfe2010-11-221-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the escaping of valid UTF-8 sequences as "\uXXXX". This code was unreliable, as it relied on Iconv's ability to convert those codepoints between UTF-8 and UTF-16, but some versions of Iconv barf on some valid codepoints. Invalid UTF-8 sequences are still passed through unchanged. We believe that this is fine; if you are concerned about complience with the JSON standard, what we are doing is equivalent to: * interpreting binary files as Latin-1 encoded character sequences * JSON-encoding those characters according to RFC 4627 * outputting the JSON as Latin-1 This allows all raw binary files to be transmitted losslessly. Paired-With: Paul Berry <paul@puppetlabs.com>
* | maint: Fix tests that don't run on their ownMatt Robinson2010-11-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the spec directory I found all the specs that fail when run on their own. for TEST in `find . -name "*.rb" -type f`; do spec $TEST > /dev/null 2>&1 if [[ $? != 0 ]]; then echo $TEST fi done All of them were cases of missing requires. Paired-with: Nick Lewis <nick@puppetlabs.com>
* | Merge remote branch 'masterzen/feature/master/4339' into nextPaul Berry2010-11-227-18/+69
|\ \ | | | | | | | | | | | | Manually resolved conflicts: spec/unit/configurer_spec.rb
| * | Fix #4339 - Locally save the last report to $lastrunreportBrice Figureau2010-11-134-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Using the cache terminus system, when --report is on, we are now caching the last report as a yaml file in the $lastrunreport file (which by default is $statedir/last_run_report.yaml). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix #4339 - Allow puppet apply to save last run summaryBrice Figureau2010-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | Puppet apply inconditionally saves its last run summary like puppet agent. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yamlBrice Figureau2010-11-134-18/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'ticket/2.6.x/5370' into nextPaul Berry2010-11-221-1/+1
|\ \ \
| * | | (#5370) Made metrics and --summarize work with Puppet applyPaul Berry2010-11-221-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puppet apply and Puppet agent use different code paths to run the transaction. In the code path for Puppet apply, we weren't passing the report to catalog.apply, and as a result catalog.apply was creating its own report to store metrics in; this report was then discarded. As a result, reports generated using "puppet apply" had no metrics, and the "--summarize" option didn't work at all. Fixed by modifying the "puppet apply" code path to pass the report to catalog.apply. In the future it would be nice to refactor the two code paths to be the same. Paired-with: Jesse Wolfe <jesse@puppetlabs.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 branch 'ticket/next/5274' into nextNick Lewis2010-11-172-72/+32
|\ \ \
| * | | (#5274) New comment property for the hosttypeStefan Schulte2010-11-172-72/+32
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the parsefile provider for host parses /etc/hosts, it throws any inlinecomment away. As a result they are also purged in /etc/hosts after a puppetrun that detects a change. That could be dangerous because you will lose information even about unmanaged resources. So if you have something like 192.168.0.1 hostentry_not_managed_by_puppet # Important comment in /etc/hosts the endresult will be 192.168.0.1\thostentry_not_managed_by_puppet This patch introduces a new property "comment" for the host type. The provider is nearly a complete rewrite and a lot shorter and hopefully easier to understand.
* | | Merge branch 'ticket/next/5288' into nextNick Lewis2010-11-171-2/+2
|\ \ \
| * | | Fixed #5288 - Changed report default to trueJames Turnbull2010-11-141-2/+2
| | |/ | |/|
* | | (#5304) Use internal_name rather than real_name for maillist providerNigel Kersten2010-11-171-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | We've switched to using list_lists --bare which shows the internal_name rather than "real_name", which is the authoritative identifier. Doing this also means we have less output to scrub, so the code is simpler. Signed-off-by: Nigel Kersten <nigel@puppetlabs.com>
* | | Merge commit '2.6.3' into nextPaul Berry2010-11-1731-219/+155
|\ \ \ | | |/ | |/| | | | | | | | | | Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
| * | Fix test failures that fixing #4726 exposed.Jesse Wolfe2010-11-161-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The patch for #4726 causes old unit tests of the rrd reporting infrastructure to run on my machine. These tests were calling the old report api, which does not succeed. Also, the rrd settings had unintentionally been moved out of the :metrics section, making it possible that the rrd report directory would fail to get created during testing.
| * | (#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 #4279 -- mount detection on HP-UXMarkus Roberts2010-11-161-1/+1
| | | | | | | | | | | | | | | This is based on the discussion on ticket, simplified slightly and with test adjustment.
| * | Fix for #5055 -- adding to_sym to Puppet::Node::EnvironmentMarkus Roberts2010-11-161-0/+4
| | | | | | | | | | | | | | | | | | The currious part is that this wasn't noticed before since it appears to block server-first migration to 2.6.x and doesn’t appear to be the consequence of a recent (2.6.3) change (unless, as is quite possible, I’m missing something).
| * | Fix for #5298 -- Collections need to do type lookupMarkus Roberts2010-11-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the responsibility for type-name resolution was moved to the AST nodes in commit 449315a2c705df2396852462a1d1e14774b9f117, at least one instance was missed: the space ship operator Myclass <<| tag == foo |>> fails unless Myclass has been previously loaded. This commit adds the lookup to AST::Collection nodes in the same way it was added to the other node types. Note that I haven't audited the other note types for similar cases.
| * | Step towards [5298] -- cleanup indentation, etc. in AST::CollectionMarkus Roberts2010-11-161-51/+33
| | | | | | | | | | | | My code smell routines bobbled this one, so I'm fixing it manually.
| * | Fixed #5287 - Schedule documentation is incorrectJames Turnbull2010-11-161-5/+5
| | |
| * | Fix for #5273 -- user resource constantly resetting password ageMarkus Roberts2010-11-162-4/+4
| | | | | | | | | | | | | | | | | | | | | The query methods for the newly added password age properties didn't have the same name as the properties, and thus the default retrieve method wan't finding them and never got the current value from the provider. They were therefore always seen as :absent and puppet always thought they needed to be set.
| * | Fix for #4299 -- Don't require whichMarkus Roberts2010-11-127-32/+11
| | | | | | | | | | | | | | | | | | 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 #5020 - Prefer finding node name from REST uri over certnameBrice Figureau2010-11-121-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a behavior change. Before this patch, we always used the currently connected node's certname to compile the catalog, despite the value of the catalog URI REST request. With this patch we now use the URI as the compiled node name. This is safe because the default auth.conf (and default inserted rules when no auth.conf is present) only allow the given connected node to compile its own catalog. But this also allows for greater flexibility with auth.conf. For instance it can be used by a monitoring system to check multiple nodes catalogs with only one certificate: path ~ ^/catalog/([^/]+)$ method find allow $1 allow monitoring-station.domain.com Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix for #4955 -- Race condition & memory leak in Puppet::UtilMarkus Roberts2010-11-124-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #4921 - race condition in Parser Functions creationBrice Figureau2010-11-121-2/+4
| | | | | | | | | | | | | | | | | | | | | The autoloading is not thread safe, which means two threads could both autoload the same function at the same time. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix #5252 - line number mis-attribution during parsingBrice Figureau2010-11-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a resurgence of #2366 that appeared because of the commit 8971d8. Before this commit, for associating documentation comments, we were preferring line numbers coming from the parser currently reducing rule, instead of the current lexer line number (which can be in advance of several tokens due to the nature of LALR parsers). We now merge the ast line number before fetching the comment from the lexer. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix for #2568 -- Add a dbconnections option to set AR pool sizeMarkus Roberts2010-11-102-0/+4
| | | | | | | | | | | | | | | The dbconnection option, if set to a positive integer, will be passed to active record as the connection pool size (pool).
| * | Maint. Removing code for which no CLA has been signedMarkus Roberts2010-11-102-9/+0
| | | | | | | | | | | | | | | Multiple attemps were made to contact the author of this code in order to obtain a Contributor Licence Agreement, but we were unable to do so.
| * | Reimplementation of functionality removed by prior commitMarkus Roberts2010-11-101-1/+9
| | | | | | | | | | | | | | | This commit implements the base path-to-source functionality and adds an (adapted) version of Matt's code on top of it.
| * | Refactor for CLAMarkus Roberts2010-11-101-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes code contributed by Ryan McBride, an author we have been unable to contact to sign a Contributor License Agreement. It also removes code writen by Matt Robinson (a Puppet Labs employee) which only made sense in the context of the removed code. The code in question comes from these commits: 6ac36eb4 Matt Robinson 55a9009c Ryan McBride
| * | 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
| | |
| * | (#4573) FreeBSD service provider now supports versions <7 and >8Nick Lewis2010-11-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running "/etc/rc.d/SERVICE rcvar" outputs different formats for different versions of FreeBSD. This patch adds support for those formats, as well as tests. Based on patches from: o Joost van Beurden o Russell Jackson Paired-With: Matt Robinson
| * | 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>
| * | [#4813] Remove dead code from puppet/rails/host.rbMatt Robinson2010-11-101-72/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | def self.clean – became orphaned in commit 28cee40689440388994a4768bd301ae32c8ecc05 def self.store – became orphaned in commit 863c50b1273a7fa48d74fb74948938214b45967c def fact – was added as a helper method for unit tests in commit 9f4870637ce57d548d23c0b3330200014327c268. The test file that used this method was removed in commit 93246c0c70796a606fc8c05b51e1feb09c94e377 def update_connect_time – Not sure when this was ever used. I also ran a client master storeconfigs run a few times and didn’t see any problems, so I’m pretty sure deleting these methods is safe.
| * | 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>
| * | Fix #5127 - error when accessing array elementsBrice Figureau2010-11-101-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accesing an array with an integer index (ie $array[1]) is producing a ruby error: can't convert String into Integer This is because the array index is not properly converted to an number before the array element lookup is performed. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Kludge for #5206 -- port of fix for #3536 to yamlMarkus Roberts2010-11-102-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
| * | (#5233) Randomize tmp dir pathsMatt Robinson2010-11-081-0/+2
| | | | | | | | | | | | | | | | | | | | | Standardize how we create tmpdirs by using the puppet function instead of Dir.tmpdir. Paired-with: Paul Berry <paul@puppetlabs.com>
* | | Merge branch 'next' of git://github.com/puppetlabs/puppet into nextMarkus Roberts2010-11-171-77/+57
|\ \ \
| * | | (#5079) Refactor and cleanup mcxcontent providerMatt Robinson2010-11-161-40/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rework for diff clarity of a patch submitted by Sandor Szuecs <sandor.szuecs@fu-berlin.de> Reviewed-by: Paul Berry <paul@puppetlabs.com>
| * | | (#5079) Move methods around to make it clearer whether they're public or privateMatt Robinson2010-11-161-51/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One method was showing up as a private class method, which turns out isn't possible, so it got moved into the public section. This is a rework for diff clarity of a patch submitted by Sandor Szuecs <sandor.szuecs@fu-berlin.de> Reviewed-by: Paul Berry <paul@puppetlabs.com>
* | | | Merge branch 'ticket/next/4590' into nextMarkus Roberts2010-11-172-208/+224
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | Conflicts: lib/puppet/util/monkey_patches.rb -- two unrelated additions had been made, kept them both.