summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Revert "(#5935) Allow functions to accept negated values"Nick Lewis2011-02-212-980/+962
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e3c59df2b246fe5e764272f21b631a5d2f28687f. This commit is being reverted because the solution is incomplete, and a better solution is out of scope for this release. A more complete solution will be implemented in the future.
* | | | Merge branch 'ticket/2.6.next/4922' into 2.6.nextNick Lewis2011-02-281-1/+0
|\ \ \ \
| * | | | (#4922) Don't truncate remotely-sourced files on 404Nick Lewis2011-02-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were 'handling' 404's on remote file content retrieval by returning nil rather than raising an exception. This caused no content to be written to the temporary file, but still appeared successful, so the destination file was overwritten, instead of preserved. Now we just handle 404 like any other error. Note that the root cause of these 404s seems to have been #4319, which has been fixed. However, in the event we do happen to get a 404 here, it's better not to have code to specifically handle it incorrectly. Paired-With: Max Martin Reviewed-By: Matt Robinson
* | | | | Merge branch 'ticket/2.6.next/4914' into 2.6.nextPaul Berry2011-02-283-83/+115
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/4914: Revert "(#6309) Ensure the correct device is mounted when managing mounts" (#4914) Improved stubbing in mount/parsed_spec tests. (#4914) Improved parsed_spec for mount (#4914) Remove mount specs (#4914) Specs for mounted? match new behaviour (#4914) Add specs for modified mount provider (#4914) Add specs for modified mount type (#4914) Update property blocks (#4914) Query property_hash for mountstate (#4914) Prefetch mountstate (#4914) Join lines for better readability
| * \ \ \ \ Merge branch 'ticket/2.6.x/4914' into maint/2.6.next/revert-6309Paul Berry2011-02-283-38/+107
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.x/4914: (#4914) Improved stubbing in mount/parsed_spec tests. (#4914) Improved parsed_spec for mount (#4914) Remove mount specs (#4914) Specs for mounted? match new behaviour (#4914) Add specs for modified mount provider (#4914) Add specs for modified mount type (#4914) Update property blocks (#4914) Query property_hash for mountstate (#4914) Prefetch mountstate (#4914) Join lines for better readability Conflicts: lib/puppet/provider/mount.rb lib/puppet/provider/mount/parsed.rb spec/unit/provider/mount/parsed_spec.rb spec/unit/provider/mount_spec.rb spec/unit/type/mount_spec.rb
| | * | | | | (#4914) Improved parsed_spec for mountStefan Schulte2011-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add specs for the new prefetching and the correct parsing of vfstab on Solaris and fstab on other systems
| | * | | | | (#4914) Update property blocksStefan Schulte2011-01-251-20/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The action for a specific ensure state depends on the actual state so we cannot use the default behaviour. The following transitions are now supported (with ghost = mounted but not present in fstab): * 4 Is-states : absent, mounted, unmounted, ghost * 4 Should-states: absent, mounted, present, unmounted * from ghost to present -> create * from absent to present -> create * from ghost to unmounted -> create, umount * from mounted to unmounted -> umount * from absent to unmounted -> create * from ghost to absent -> umount (may fail on certain OS) * from mounted to absent -> umount, destroy * from unmounted to absent -> destroy * from ghost to mounted -> create * from absent to mounted -> create, mount * from unmounted to mounted -> mount Every other combination is treatet insync
| | * | | | | (#4914) Query property_hash for mountstateStefan Schulte2011-01-251-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change mounted? to query the property_hash so we don't have to run the mountcommand for every specified mount but rely on the prefetched state Also update the prefetched property_hash[:ensure] after mount or umount. This is important if we query mounted? later (most obvious when refresh is called. We dont want to remount a resource that was umounted before)
| | * | | | | (#4914) Prefetch mountstateStefan Schulte2011-01-251-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a method mountinstances that returns a list of currently mounted filesystems and overwrite prefetch to update the :ensure state of a mount resource to either - :absent => not in fstab and not mounted - :unmounted => in fstab but not mounted - :mounted => in fstab and mounted - :ghost => not in fstab but mounted This is just one step towards 4914. Next will be query the property_hash when asking mounted? and update the insync? methods to handle the different states.
| | * | | | | (#4914) Join lines for better readabilityStefan Schulte2011-01-251-9/+2
| | | | | | |
| * | | | | | Revert "(#6309) Ensure the correct device is mounted when managing mounts"Paul Berry2011-02-252-50/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6cb365a887d47606bdfae0ff540038b0c49b7451, which fixed bug #6309 but introduced bug #6411. In addition, it conflicts with a significant patch to the mount provider that addresses #4914. After merging in the fix for #4914 I will determine whether bug #6309 still exists, and if so work on an improved fix for it.
* | | | | | | Merge branch 'ticket/2.6.next/maint-remove_version_control_tags' into 2.6.nextMatt Robinson2011-02-287-15/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/maint-remove_version_control_tags: (#6338) Remove unused version control tags
| * | | | | | | (#6338) Remove unused version control tagsMatt Robinson2011-02-287-15/+0
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Older version control systems like CVS and SVN used to use these $Id$ tags for version information. Paired-with: Nick Lewis
* | | | | | | Maint: Align tabs in a code block in the Augeas type.nfagerlund2011-02-281-4/+4
| | | | | | |
* | | | | | | (#6509) Inline docs: Fix erroneous code block in directoryservice provider ↵nfagerlund2011-02-281-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for computer type
* | | | | | | Maint: Rewrite comments about symlinks to reflect best practice.nfagerlund2011-02-282-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use ensure => 'path/to/file', because it's hard to read. Use ensure => link and specify a target =>.
* | | | | | | (#6509) Inline docs: Fix broken lists in Launchd provider.nfagerlund2011-02-281-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Lists need a leading linebreak.
* | | | | | | (#6509) Inline docs: Fix broken code blocks in zpool typenfagerlund2011-02-281-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This one was subtle. If the first paragraph of a Markdown string embedded in a type isn't multiple lines, a code block immediately following it will not be recognized. So, hard-wrap or die, I guess.
* | | | | | | (#6509) Inline docs: Fix code blocks in service type.nfagerlund2011-02-282-10/+10
| | | | | | |
* | | | | | | (#6509) Inline docs: fix broken code blocks in schedule.rb.nfagerlund2011-02-281-20/+20
| | | | | | |
* | | | | | | (#6509) Inline docs: Fix broken code block in file type (content attribute)nfagerlund2011-02-281-12/+12
|/ / / / / /
* | | | | | Merge remote branch 'brice/tickets/2.6.x/6267' into 2.6.nextJesse Wolfe2011-02-252-0/+57
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Fix #6267 - puppetdoc embedded links to puppet entities are not hyperlinkedBrice Figureau2011-02-122-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puppetdoc was relying on RDoc to provide the puppet entity (class, definition node, etc...) hyperlinking in comments. Unfortunately, RDoc was assuming namespaces are capitalized like Ruby namespaces and that definition would use the # or . separator. This change adds on top of RDoc puppet namespace format for classes and definition. This will make sure the comment hyperlinking will work as intented. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | | | | | (#3999) Allow disabling of default SELinux context detection for filesJesse Wolfe2011-02-251-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases on a system with SELinux, it is preferred to use the SELinux matchpathcon call to determine the default context that a file should have to make sure that files Puppet modifies are labeled with the correct SELinux security context. In the event that you wanted to override some or all of the default context, you can use the SELinux attributes Puppet provides to do that. If left unspecified the defaults will apply if matchpathcon has defaults. This patch adds a new selinux_ignore_defaults parameter which will cause Puppet to assume no defaults, allowing the file's SELinux label to be left unmodified, if desired. Originally-by: Sean Millichamp <sean@bruenor.org> Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* | | | | | Merge branch 'ticket/2.6.next/6322' into 2.6.nextJesse Wolfe2011-02-252-2/+2
|\ \ \ \ \ \
| * | | | | | (#6322) --noop should not suppress error codesJesse Wolfe2011-02-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The noop option has been suppressing exit statuses. This is counterintuitive, as per discussion at http://projects.puppetlabs.com/issues/6322 This patch causes noop runs to return the same exit codes as real runs. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | (#6499) Make puppet respond identically to -h and --helpnfagerlund2011-02-251-1/+1
|/ / / / / / | | | | | | | | | | | | | | | | | | lib/puppet/util/command_line.rb had a special case for puppet --help to return generic help instead of the puppet apply help, but it would return puppet apply help when you gave it -h.
* | | | | | Merge branch 'ticket/2.6.next/6331' into 2.6.nextnfagerlund2011-02-231-2/+1
|\ \ \ \ \ \
| * | | | | | (#6331) Remove final special :trac: link from the file content propertynfagerlund2011-02-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file content property had a weird garbage string in its doc variable which appeared to be part of our older reference generator code. Since the code to strip these odd links out no longer appears to exist, the nonsense would propagate to the generated types reference.
* | | | | | | Maint: Add an assertion mechanism to PuppetPaul Berry2011-02-231-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows us to make C-style "assertions" in Puppet code, e.g.: assert_that { condition } assert_that(message) { condition } These methods will raise an exception if the environment variable PUPPET_ENABLE_ASSERTIONS is set to a non-empty value, and the the condition evaluates to false. If the environment variable PUPPET_ENABLE_ASSERTIONS is not set, then the condition is not even checked. Switching the assertions on with PUPPET_ENABLE_ASSERTIONS carries three advantages: 1. It makes it possible to put potentially expensive checks in assertions without degrading the performance of the code in production environments. 2. It allows strict assertions to catch Puppet bugs early in development, without increasing the risk of a crash in production environments. 3. It allows a simple command-line mechanism to run any Puppet command with assertions enabled.
* | | | | | | Merge branch 'ticket/2.6.next/6418' into 2.6.nextJesse Wolfe2011-02-231-14/+0
|\ \ \ \ \ \ \
| * | | | | | | (#6418) Recursive files shouldn't be auditedJesse Wolfe2011-02-231-14/+0
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A vestigial codepath was accidentally made live again when 2.6.0's audit parameter was added. This patch removes that code. As it's very difficult to write a meaningful unit test of a negative case, a test will be added to the acceptance test project to confirm before & after behavior for this fix. Reviewed-By: Markus Roberts <markus@puppetlabs.com>
* | | | | | | (#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testingDaniel Pittman2011-02-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a combination of bad logic, and bad testing, and a nasty behaviour of Mocha <= 0.9.10 that would result in a false pass for one of our tests. This not only falsely passed, but hid an infinite loop retrying decompression on an invalid data stream; it could be triggered by anything that sent an HTTP request with an invalid compressed body, resulting in a livelock. Paired-with: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | (#5552) Display help when no subcommand is given.Daniel Pittman2011-02-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when the command line was empty we would try and invoke an empty method; this was less helpful than telling people what they could actually do, so we adapt our code to do precisely that. Paired-With: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | (#5552) Clean up subcommand handling inside puppet cert.Daniel Pittman2011-02-221-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now have a regular, testable mechanism for handling the legacy '--' version of subcommands, as well as a modern bareword subcommand pattern. This makes it sensible to test command handling and avoid regressions. We identified a few quirks in the command line as part of this process. Pair-With: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | Merge branch '2.6.x' into 2.6.nextJacob Helwig2011-02-213-72/+104
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: Updated CHANGELOG for 2.6.5rc5 (#6337) Fix Ruby warning on 1.8.6 about "future compatibility" (#6353) Restore the ability to store paths in the filebucket (#6126) Puppet inspect now reports status after run completes.
| * | | | | | (#6337) Fix Ruby warning on 1.8.6 about "future compatibility"Daniel Pittman2011-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.8.6 (but not later versions) warn about requiring parenthesis on some function calls; having one of those in our network rights checking means that we emit ... quite a few of these, and annoy anything that tracks our logs. By using the more standard form of raise we can avoid the warning entirely, and keep consistent code style across the file. Reviewed-By: Paul Berry <paul@puppetlabs.com>
| * | | | | | (#6353) Restore the ability to store paths in the filebucketPaul Berry2011-02-212-15/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2274d5104f6e413a2b8899a3c3111a17bbb2f4d7 optimized network usage for the case where a file is already in the filebucket. However, it took away the ability to store paths. This change restores the ability to store paths while maintaining optimal network usage for the case where the file is already in the filebucket with the given path. This is expected to be the most common case. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | | | (#6126) Puppet inspect now reports status after run completes.Daniel Pittman2011-02-181-57/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now emit timing and output a status message at the end of a successful inspect run. Paired-With: Nick Lewis <nick@puppetlabs.com> Signed-Off-By: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | Merge branch 'tickets/2.6.x/6309-check-what-is-mounted' into 2.6.nextJacob Helwig2011-02-183-20/+52
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tickets/2.6.x/6309-check-what-is-mounted: Remove pending tests from parsed mount provider (#6309) Ensure the correct device is mounted when managing mounts Clean up whitespace, and commented out code in parsed mount provider
| * | | | | | | (#6309) Ensure the correct device is mounted when managing mountsJacob Helwig2011-02-182-13/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the mount type would only check if anything was mounted at the desired point, when 'ensure => mounted' was specified. Now we check not only whether something is mounted at the desired point, but also that it is the thing we wish to be mounted there. There is also a chance that the mount point directory could be "automagically" removed for us, when unmounting incorrect devices, so we attempt to re-create the directory after unmounting to give the mount of the correct device a better chance at succeeding. Paired-with: Matt Robinson <matt@puppetlabs.com> Paired-with: Nick Lewis <nick@puppetlabs.com> Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | | | | Clean up whitespace, and commented out code in parsed mount providerJacob Helwig2011-02-181-7/+2
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | Merge branch 'tickets/2.6.x/6364-fix-mount-provider-on-aix' into 2.6.nextJacob Helwig2011-02-181-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tickets/2.6.x/6364-fix-mount-provider-on-aix: (#6364) Adjust mis-translated regex in mount provider for AIX
| * | | | | | (#6364) Adjust mis-translated regex in mount provider for AIXJacob Helwig2011-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit to simplify the regex used to parse the output from the mount command on AIX (50c12e55b6f8462f6904ae061e661d1d10c7590a) mis-translated it. The original regex was grabbing the 3rd space-separated element, not the 2nd. This mis-translation caused the provider to grab the device information instead of the mount point, and compare that to the desired mount point. This would cause Puppet to think that the mount was never actually mounted under normal circumstances. The code from 50c12e5 was passing the tests because the fixture data did not include the mandatory leading whitespace that the original regex was looking for. The updated fixture data is pulled from the mount manpage from AIX v6r1. Reviewed-by: Paul Berry <paul@puppetlabs.com>
* | | | | | | (#6376) Add support and testing for _search GET requestsMax Martin2011-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for adding "_search" to the end of any indirection to 'pluralize' it, and added tests to check this functionality and to test hidden side effect of plurality method unpluralizing indirections. Paired-With:Paul Berry <paul@puppetlabs.com>
* | | | | | | (#6337) Fix Ruby warning on 1.8.6 about "future compatibility"Daniel Pittman2011-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.8.6 (but not later versions) warn about requiring parenthesis on some function calls; having one of those in our network rights checking means that we emit ... quite a few of these, and annoy anything that tracks our logs. By using the more standard form of raise we can avoid the warning entirely, and keep consistent code style across the file. Reviewed-By: Paul Berry <paul@puppetlabs.com>
* | | | | | | (#5150) Make fact REST terminus configurable to connect to inventory serviceMatt Robinson2011-02-172-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puppet masters can now set the inventory_server and inventory_port option to point to another puppet master that will function as the central inventory service. When agents connect to the puppet master, this will send fact data from the puppet master over REST to the inventory service. The puppet master itself will still store the client fact data in the local yaml dir by setting the cache class to yaml. Getting puppet masters to talk to each other using certs is difficult. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | (#5166) Inventory service is now searchable by timestamp.Paul Berry2011-02-171-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is now possible to specify queries in the form “meta.timestamp.xx” where xx is eq,ne,gt,lt,ge,le when searching the inventory service.
* | | | | | | Maint: backport timestamp accessor for facts from 2.7 branchPaul Berry2011-02-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | | Refactor Puppet::Node::Inventory::Yaml in preparation for adding freshnessPaul Berry2011-02-171-17/+29
| | | | | | |