Age | Commit message (Collapse) | Author |
|
This commit makes several minor consistency and wording edits to the doc
strings of the stdlib functions.
|
|
Code examples in several function doc strings were only indented by two
spaces, which would not result in proper display when rendered as HTML. This
commit corrects the indentation to four spaces.
|
|
This commit replaces the example in the merge function with a much clearer
one. It also mentions that the rightmost value wins in the event of duplicated
hash keys.
|
|
certificates from a CA (or locally).
This function works by either obtaining the file locally
or remotely based on Puppets configuration.
Also added get_pubkey which wraps get_certificate and extracts the
public key.
|
|
It was decided that maintaining puppetlabs-functions and
puppetlabs-stdlib was duplication as both are trying to
achieve the same goal.
This patch provides a merge of the puppetlabs-functions
into the puppetlabs-stdlib repository, with history
preservation.
The following conflicts were found and resolved:
* LICENSE file from functions was used as it aligns with
ASL usage instructions and contains relevant copyright
information:
http://www.apache.org/licenses/LICENSE-2.0.html
* Used spec_helper.rb from functions - this is what
Puppet core uses and doesn't break tests.
* Merged .gitignore and spec.opts options.
|
|
* Re-arranged tests in line with puppetlabs-stdlib
|
|
* Renamed load_yaml & load_json to parseyaml & parsejson
* Renamed is_valid_* functions and remove the 'valid_'
|
|
The accounts module is making use of validate_array() and
validate_string() which do not exist int he stdlib module without this
patch.
This patch adds the two functions to the stdlib with unit tests.
Reviewed-by: Dan Bode
|
|
The previous behavior of the merge() function used Array#inject with two
arguments. Ruby 1.8.5 only supports inject being used with one
argument.
This change initializes and empty Hash object and merges each argument
into the accumulator. The last argument still "wins" in the merge.
rspec tests (cd spec; rspec **/*_spec.rb) verified as passing with this
change.
Reviewed-by: Dan Bode
|
|
|
|
In Puppet, it is not possible to reassign hash
values.
This function allows a reasonable way to perform
hash munging in Puppet.
Reviewed-by: Jeff McCune
|
|
It is difficult to use existance of keys in a hash
as a boolean condition in Puppet (see #8705)
This function provides a working solution until
the underlying issue in Puppet can be resolved.
Reviewed-by: Jeff McCune
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
own.
|
|
function on its own.
|
|
|
|
|
|
|
|
This change adds a loadyaml() puppet function that takes a path to a
YAML data file and returns the contents as a Puppet variable. There is
currently no validation of the contents of the file.
This commit is intentionally lacking unit tests because of time
constraints.
Reviewed-by: Dan Bode
|
|
|
|
as well)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function validates all passed variables are hashes. This is
similar to the validate_bool function and is copied from it.
|
|
This isn't directly related to #8010, but rather indirectly fills the
need to allow the end user to configure where data values are looked up.
This allows the namespace to be passed as a class parameter. A module
may then quickly and easily look up data from the user-defined
namespace.
|
|
This function aborts catalog compilation if any of the passed
values are not true or false. Note, this catches the string
values of true and false correct and will abort catalog
compilation if they are not boolean values.
Paired-with: Dan Bode <dan@puppetlabs.com>
|
|
While developing Puppet Modules with class parameters, data from the
user should be validated as per the Style Guide. Puppet should fail
early and hard in the situation of invalid data being passed into the
module.
This function provides a more concise method to the alternative of using
if statements in the Puppet manifests.
|
|
|
|
|
|
|