summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | (#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>
| | * | | | | Merge branch 'maint/2.6.x/fix_plaform_detection' into 2.6.xDominic Maraglia2011-07-122-3/+2
| | |\ \ \ \ \
| | | * | | | | (maint) Fix platform dection for RHELDominic Maraglia2011-07-122-3/+2
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detecting supported platform used incorrect string for RHEL. Changed string from 'redhat' to 'rhel'
| * | | | | | Merge branch 'ticket/2.7.x/maint-fix_doc_link' into 2.7.xMatt Robinson2011-07-141-1/+1
| |\ \ \ \ \ \ | | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | * ticket/2.7.x/maint-fix_doc_link: maint: Fix documentation link for fileserver configuration
| | * | | | | maint: Fix documentation link for fileserver configurationMatt Robinson2011-07-141-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The link to the filesever configuration page linked to the wiki, which links back to the docs site. Short circuiting that do just link to where you want to go. Reviewed-by: Nick Lewis <nick@puppetlabs.com>
| * | | | | Merge branch 'ticket/2.7.x/4142-metadata_json' into 2.7.xMatt Robinson2011-07-122-10/+42
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.7.x/4142-metadata_json: (#4142) Fix module check not to fail when empty metadata.json
| | * | | | | (#4142) Fix module check not to fail when empty metadata.jsonMatt Robinson2011-07-122-10/+42
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though the puppet module tool was fixed to generate the required metadata attributes when it packages modules, it still creates an empty metadata.json file that gets checked into everybody's module repos. This causes the module to be unusable straight from a git clone since puppet was requiring all the required metadata attributes just with the presence of that file, and resulting in the error: No source module metadata provided for mcollective at This change makes it so that if you have an empty metadata.json (like the moduletool generates), puppet doesn't consider it to have metadata. If you have ANY metadata attributes in that file, it will still check to make sure all the required attributes are present. The work around up to this point has just been to delete the metadata.json file in git cloned modules. This also fixed the tests around this to actually run, since previously the tests depended on the a json feature, which we didn't have. We do, however, have a pson feature. Reviewed-by: Nick Lewis <nick@puppetlabs.com>
| * | | | | Revert "Merge branch 'ticket/2.7.x/7699_fix_help_listing_options_twice' into ↵Jeff McCune2011-07-104-21/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2.7.x" This reverts commit b7ee0258ab40478329c20177eda9b250f27ede18, reversing changes made to 8fe2e555ac3d57f5b6503ffe1a5466db8d6e190a.
| * | | | | Merge branch 'ticket/2.7.x/7699_fix_help_listing_options_twice' into 2.7.xJeff McCune2011-07-104-2/+21
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.7.x/7699_fix_help_listing_options_twice: (#7699) - Help should only show options once
| | * | | | | (#7699) - Help should only show options onceDan Bode2011-07-104-2/+21
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | puppet help was reprinting every option once for every alias that is had. This fix involves only storing the option.name in the @options instance var for both face and actions options. The @options_hash still maintains the list of options and aliases as its keys. Reviewed-by: Daniel Pittman (puppet-dev list)
| * | | | | Merge branch 'ticket/2.7.x/8032_create_resource_containment' into 2.7.xJeff McCune2011-07-101-5/+6
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.7.x/8032_create_resource_containment: (#8032) Add containment to create_resources
| | * | | | | (#8032) Add containment to create_resourcesJeff McCune2011-07-101-5/+6
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this change native resource types declared using the create_resources() function are not contained within the class scope of the function call. As a result, resources were "floating off" in the graph, disconnected from the rest of the relationship edges. With this change, the scope is preserved and native resources are contained by the class the function call is executed from. Reviewed-by: Dan Bode <dan@puppetlabs.com>