summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | Merge branch 'ticket/2.6.x/8596' into 2.6.xNick Lewis2011-07-252-10/+60
| | |\ \
| | | * | (#8596) Detect resource alias conflicts when titles do not matchNick Lewis2011-07-252-10/+60
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The introduction of composite namevars caused the resource title used in resource aliases to be set as an array, even when the resource only had one namevar. This would fail to conflict with non-alias entries in the resource table, which used a string for the title, even though the single element array contained the same string. Now, we flatten the key used in the resource table, so that single element arrays are represented as strings, and will properly conflict with resource titles. Paired-With: Jacob Helwig <jacob@puppetlabs.com>
| | * | Merge branch 'ticket/2.6.x/8418-inspect_respect_run_mode' into 2.6.xMatt Robinson2011-07-255-8/+20
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.x/8418-inspect_respect_run_mode: (#8418) Fix inspect app to have the correct run_mode maint: Adding logging to include environment when source fails maint: Add debug logging when the master receives a report
| | | * | (#8418) Fix inspect app to have the correct run_modeMatt Robinson2011-07-252-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requiring puppet before the run_mode has been set by the application causes the default run_mode of 'user' to be set instead of what the application wants. This leads to the incorrect default settings to be used, which lead to inspect not being able to properly retrieve file metadata from a fileserver. Reviewed-by: Max Martin <max@puppetlabs.com>
| | | * | maint: Adding logging to include environment when source failsMatt Robinson2011-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | Reviewed-by: Max Martin <max@puppetlabs.com>
| | | * | maint: Add debug logging when the master receives a reportMatt Robinson2011-07-252-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's always bothered me that when running puppet inspect (or any application that produces a report really) the master gives no indication that anything happened when it processes the report. Reviewed-by: Max Martin <max@puppetlabs.com>
| * | | | Merge branch 'tickets/2.7.x/7293' into 2.7.xPieter van de Bruggen2011-07-253-20/+16
| |\ \ \ \
| | * | | | (#7293) Set default format for SSL-related faces.Pieter van de Bruggen2011-07-253-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, the SSL-related faces should all render a strings, not with `Object#inspect`. Reviewed-By: Daniel Pittman
| | * | | | (Maint.) Unquoting HEREDOCs.Pieter van de Bruggen2011-07-252-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The additional quotation marks frustrate certain syntax highlighters, and are completely unnecessary for their use. Reviewed-By: Daniel Pittman
| * | | | | Merge branch '2.7rc' into 2.7.xMichael Stahnke2011-07-2511-35/+604
| |\ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge branch 'tickets/2.7.x/7266' into 2.7.xPieter van de Bruggen2011-07-253-18/+29
| |\ \ \ \ \
| | * | | | | (#7266) Move Certificate option validation into face.Pieter van de Bruggen2011-07-253-18/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The validation for the ca_location option on the certificate application continued to hang around on the application long after the face realized its potential to take responsibility for itself. This change moves (and adds) validation code as appropriate into the Face. Reviewed-By: Matt Robinson
| * | | | | | maint: Fix Face testing bug 1.9.2 revealed.Daniel Pittman2011-07-252-4/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.8.7 is fairly lax about various bits of introspection, including that we can't tell much about what arguments a block takes. Ruby 1.9.2 makes it possible to do this, though. Meanwhile, the Faces system uses this to make sure that scripts and actions take the right set of arguments, to avoid surprises: failing early and explicitly is better than failing at runtime. Which, in final turn, exposes that I forgot to accept the right arguments in a couple of my testing actions for Faces, but didn't notice because 1.8.7 doesn't check that, and I didn't test on 1.9.2.
| * | | | | Merge branch 'refactor/2.7.x/8561-and-7290-improved-option-handling' into 2.7.xDaniel Pittman2011-07-224-51/+109
| |\ \ \ \ \
| | * | | | | (#7290) Update indirected Faces to avoid unknown options.Daniel Pittman2011-07-222-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we enforce that options must be declared, the model we exposed in the Ruby API (but not the CLI facade) was that you could pass additional arguments to the indirection method by passing them as unknown options doesn't work. Instead, explicitly declare an option, `extra`, that accepts the final argument to be passed direct to the indirection. This makes things work smoothly, as well as making it possible (once you can input a hash on the command line) to invoke extra arguments from the facade too... Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | maint: don't print inside action implementations.Daniel Pittman2011-07-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than printing directly, we should return the data from the Action and allow the facade to route that to the user directly. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#8561, #7290) Implement the option contract fully.Daniel Pittman2011-07-222-40/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite the process of validating and updating the options to fully reflect the contract - we fail if there are unknown options passed, report nicely errors of duplicate names, pass only the canonical names to the action code, and generally enforce nicely. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#8561) Unify validation and modification of action arguments.Daniel Pittman2011-07-222-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than having multiple, separate operations that modify and validate the arguments to an action, a single pass makes sense. This also means less walks across the set of data, and a few less expensive method calls in Ruby. Additionally, we work on a duplicate of the arguments hash rather than directly modifying the original. Because everything we do is at the top level key/value mapping, this is sufficient to isolate the original. While mostly theoretical, we now don't mutilate the hash passed in, so the user won't get nastily surprised by the fact that we could have done so. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#7290) Fail on unknown options.Daniel Pittman2011-07-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the "social contract" of Faces, Actions and Options is that the metadata we collect is authoritative: it covers everything that is possible. In the initial release we didn't enforce that around options. If you passed an unknown option in the hash, we just silently ignored it in validation and made it available down in the action. Now, instead, we enforce that rule. If you pass an unknown option we raise an error and complain; anything that gets to the action will be listed in the set of inspectable options. Cases that depended on this behaviour to pass arbitrary content in the hash should be rewritten to move that content down a level: take a hash value for one option, and use that for your free content. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#8561) Use canonical names for options to actions.Daniel Pittman2011-07-221-6/+20
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we invoke an action, we parse a set of options. These have a canonical name, and optionally a set of aliases. For example, :bar might have :b as an alias to allow a short name to be given. Previously we would just pass this on as received; if you passed :bar you got :bar, and if you passed :b you got :b. This works, but means that every action has to write the same code to extract the appropriate version of an option from whatever set of aliases might be passed. Now, instead, we centralize that and always pass options as their canonical name to the action code. This makes it simpler to work with. (This happens before any validation, or other user-supplied, code to simplify everything that handles options.) Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * | | | | Merge branch 'feature/2.7.x/7184-better-action-loading' into 2.7.xDaniel Pittman2011-07-2210-19/+108
| |\ \ \ \ \
| | * | | | | (#7184) Load the core of obsolete versions of Faces.Daniel Pittman2011-07-225-18/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we define an action on an older version of a Face, we must be sure to directly load the core of that version, not just define it with the external Action(s) that it had. Otherwise we break our contract, which is that any core Actions for a specific version will be available to your external Action for as long as we support that core version. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#7184) Find actions bound to other versions of Faces.Daniel Pittman2011-07-223-3/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we first touch a Face, we load all the available Actions from disk. Given they define themselves against a specific version of a Face, they are automatically available tied to the correct version; this makes it trivially possible to locate those on demand and return them. Now, we have the ability to find and, consequently, invoke Actions on older versions of Faces. We don't load enough context, though: the older face will only have external Actions defined, not anything core. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#7184) Centralize "find action for face" into Puppet::FaceDaniel Pittman2011-07-224-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of moving to load actions first, and their associated face, when invoked from the command line, it makes sense to push the logic for finding the action and face down into the Puppet::Face implementation. This means that we can change the logic there without needing to update the public part of the CLI implementation, and that any further facades can use the same, correct, logic to locate the action for the face. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | maint: better error reporting when test failsDaniel Pittman2011-07-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test ensures, among other things, that we get a log message. If that fails, we were trying to call a random method on nil; making that an assertion means that we get a nice message rather than a failure that needs decoding. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * | | | | | Merge branch '2.6.x' into 2.7.xJacob Helwig2011-07-221-3/+13
| |\ \ \ \ \ \ | | |/ / / / / | |/| | / / / | | | |/ / / | | |/| | | * 2.6.x: Confine password disclosure acceptance test to hosts with required libraries
| | * | | | Merge branch 'confine_shadow_acceptance_tests' into 2.6.xJacob Helwig2011-07-221-3/+13
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * confine_shadow_acceptance_tests: Confine password disclosure acceptance test to hosts with required libraries
| | | * | | | Confine password disclosure acceptance test to hosts with required librariesJacob Helwig2011-07-221-3/+13
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The useradd provider has the requirement that ruby-shadow[1] be installed to be able to manage passwords. On systems where we would use the useradd provider and this library has not been installed we don't bother running the test, since we will never be able to see the output we are testing. [1] http://ttsky.net/ruby/ Signed-off-by: Jacob Helwig <jacob@puppetlabs.com> Reviewed-by: Dominic Maraglia <dominic@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
| * | | | | Merge branch '2.6.x' into 2.7.xJacob Helwig2011-07-213-0/+39
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#6857) Password disclosure when changing a user's password
| | * | | | Merge remote-tracking branch ↵Jacob Helwig2011-07-213-0/+39
| | |\ \ \ \ | | | |_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | 'barn/tickets/2.6.x/6857-password-disclosure-when-changing-a-users-password' into 2.6.x * barn/tickets/2.6.x/6857-password-disclosure-when-changing-a-users-password: (#6857) Password disclosure when changing a user's password
| | | * | | (#6857) Password disclosure when changing a user's passwordBen Hughes2011-06-013-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the should_to_s and is_to_s functions to return a form of 'redacted'. Rather than send the password hash to system logs in cases of failure or running in --noop mode, just state whether it's the new or old hash. We're already doing this with password changes that work, so this just brings it inline with those, albeit via a slightly different pair of methods.
| * | | | | Merge branch 'feature/2.7.x/6787-introduce-option-defaulting' into 2.7.xDaniel Pittman2011-07-208-5/+272
| |\ \ \ \ \
| | * | | | | (#7123) Make `find` the default action...Daniel Pittman2011-07-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the progress toward getting the `puppet status` invocation working nicely is that it should default to invoking the `find` operation. This implements that, using the new runtime default action facility. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#7123) Support runtime setting of 'default' on actions.Daniel Pittman2011-07-202-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given the inheritance model for actions, we are sometimes going to need to set them to 'default' at runtime, rather than during their static declaration. Add tests to verify that this works correctly, and update the code to ensure that happens. This gives up caching of the default action, but this should be an extremely rare operation - pretty much only CLI invocation, really. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | (#6787) Add `default_to` for options.Daniel Pittman2011-07-206-0/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implement support for options with default values, allowing faces to set those values when not invoked. This can eliminate substantial duplicate code from actions, especially when there are face-level options in use. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * | | | | | Replace calls to Array#count with #lengthNick Lewis2011-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Array#count is not available in Ruby 1.8.5, so we need to use #length in these specs for compatibility. Reviewed-By: Matt Robinson <matt@puppetlabs.com>
| * | | | | | Fix order-dependent test failure in certificate_status/file specNick Lewis2011-07-201-0/+4
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test was failing if the SSL indirections had previously been configured as :ca. The was due to the fact that we are explicitly testing the certificate_status :file terminus, which depends on the other SSL indirections using corresponding termini. This spec wasn't appropriately ensuring they were also set to :file, breaking that precondition, and causing failures. Reviewed-By: Matt Robinson <matt@puppetlabs.com>
| * | | | | Merge branch 'feature/2.7.x/6789-port-ca-interface-to-faces' into 2.7.xDaniel Pittman2011-07-204-0/+595
| |\ \ \ \ \
| | * | | | | (#6789) Port SSL::CertificateAuthority::Interface to a FaceDaniel Pittman2011-07-203-0/+593
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Puppet::SSL::CertificateAuthority::Interface class was an early prototype heading toward building out a system like Faces. Now that we have done that, this changeset ports the early code to a new face. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | | maint: SSL::Inventory.serial should report missing names.Daniel Pittman2011-07-201-0/+2
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our SSL inventory was able to find the serial number of a certificate by name, but was incapable of living up to the contract it offered, that it would actually report when a certificate was missing. Now it returns `nil`, which is the same case as "no inventory", if the certificate was not found, rather than accidentally returning the entire inventory data as raw strings. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * | | | | (#7204) Consolidate Semantic Versioning code.Pieter van de Bruggen2011-07-195-80/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a class representing a semantic version, and implementing a few of the most common uses of them: validation, comparison, and finding the greatest available version matching a range. This refactoring also allows us to easily expand our matching of version ranges in the future, which is a big plus. Reviewed-By: Daniel Pittman
| * | | | | Merge branch 'issue/2.7.x/7699' into 2.7.xDan Bode2011-07-155-3/+23
| |\ \ \ \ \
| | * | | | | (#7699) Help command should only list options onceDan Bode2011-07-135-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was caused by the fact that the options method returns a list of options that treated the aliases as seperate options. The fix is to only maintain a list of options and not add all aliases to the options list.
| * | | | | | Merge branch 'ticket/2.7.x/8401-docs-detailed-exitcodes' into 2.7.xnfagerlund2011-07-153-11/+12
| |\ \ \ \ \ \
| | * | | | | | (#8401) Document that --detailed-exitcodes is a bitmasknfagerlund2011-07-153-11/+12
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The agent/apply/device man pages mentioned the 2 and 4 exit codes, but didn't mention that they can combine to make 6 if there are both changes and failures. This commit adds the missing information to all three man pages. Reviewed-by: Matt Robinson <matt@puppetlabs.com>
| * | | | | | Merge branch '2.6.x' into 2.7.xMatt Robinson2011-07-1420-50/+83
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (maint) Cleanup and strengthen acceptance tests (#7144) Update Settings#writesub to convert mode to Fixnum (maint) Fix platform dection for RHEL Manually Resolved Conflicts: acceptance/tests/ticket_5477_master_not_dectect_sitepp.rb spec/unit/util/settings_spec.rb
| | * | | | | Merge branch 'maint/2.6.x/replace_regex_with_asserts' into 2.6.xDominic Maraglia2011-07-1415-45/+68
| | |\ \ \ \ \
| | | * | | | | (maint) Cleanup and strengthen acceptance testsDominic Maraglia2011-07-1415-45/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converted plain regex checks to use Test::Unit::Accertions. Adding more verbose output in the case of failure to speeed debugging.
| | * | | | | | Merge branch 'ticket/2.6.x/7144-private-keys' into 2.6.xMatt Robinson2011-07-143-2/+12
| | |\ \ \ \ \ \ | | | |/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | * ticket/2.6.x/7144-private-keys: (#7144) Update Settings#writesub to convert mode to Fixnum
| | | * | | | | (#7144) Update Settings#writesub to convert mode to FixnumMax Martin2011-07-143-2/+12
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Settings#writesub was not checking the type of the mode value passed in from the defaults, causing it to pass a string for mode to File.open, leading to failures. This commit resolves that issue. Paired-with: Matt Robinson <matt@puppetlabs.com>