Commit graph

537 commits

Author SHA1 Message Date
Adrien Thebo
c0a0682706 Merge branch '2.x' into 3.x 2013-03-18 15:37:56 -07:00
Adrien Thebo
4c695ede38 Merge branch 'pull-115' into 2.x 2013-03-18 15:37:46 -07:00
Justin Lambert
5d5a4d466e str2bool should return a boolean if called with a boolean 2013-03-18 15:37:36 -07:00
Adrien Thebo
c12d3d7d51 Merge branch '2.x' into 3.x 2013-03-18 15:06:07 -07:00
Adrien Thebo
967f9916d1 Merge branch 'pull-98' into 2.x 2013-03-18 15:05:23 -07:00
Uwe Stuehler
e80207bede Fix number of arguments check in flatten()
The function only uses the first argument, so raise an error with
too few arguments *and* with too many arguments.
2013-03-18 15:04:50 -07:00
Jeff McCune
4fdefd0761 Merge branch 'maint/3.x/ruby_two_travis' into 3.x
* maint/3.x/ruby_two_travis:
  (maint) Add Ruby 2.0.0 to Travis build matrix
2013-02-25 14:11:07 -08:00
Jeff McCune
03c5c4a434 (maint) Add Ruby 2.0.0 to Travis build matrix
Without this patch we're not testing against Ruby 2.0.0 which has recently been
released.  This is a problem because we'd like a way to be notified if a change
set breaks compatibility with future supported versions of Ruby.

This patch should not be taken as an indication that we fully support Ruby 2.0,
just as an indication that we plan to in the future.

This patch also tightens up the specifications of the build matrix.  In
addition to testing against the specific Puppet dependency versions, we're also
testing against the latest 2.7.x release and the latest release.
2013-02-25 14:11:03 -08:00
Jeff McCune
d2e0c53243 Merge branch '2.x' into 3.x
* 2.x:
  changed .count to .size to support legacy ruby
2013-02-18 12:22:04 -08:00
Jeff McCune
1e2ee5bd01 Merge branch 'mhellmic-2.x' into 2.x
* mhellmic-2.x:
  changed .count to .size to support legacy ruby
2013-02-18 12:21:49 -08:00
Martin Hellmich
9fa70ae43f changed .count to .size to support legacy ruby 2013-02-18 12:21:34 -08:00
Jeff McCune
d7aea0f0be Merge branch '3.2.x' into 3.x
* 3.2.x:
  Add test/validation for is_float if created from an arithmetical operation
  Add test/validation for is_integer if created from an arithmetical operation
  Add test/validation for is_numeric if created from an arithmetical operation
2013-01-03 13:38:36 -08:00
Jeff McCune
bc4abce86b Merge branch 'stephenrjohnson-bug/3.x/18157_arithmetical_operations' into 3.2.x
* stephenrjohnson-bug/3.x/18157_arithmetical_operations:
  Add test/validation for is_float if created from an arithmetical operation
  Add test/validation for is_integer if created from an arithmetical operation
  Add test/validation for is_numeric if created from an arithmetical operation
2013-01-03 13:38:16 -08:00
stephen
a773281760 Add test/validation for is_float if created from an arithmetical operation 2013-01-03 13:37:55 -08:00
stephen
b86f5dc129 Add test/validation for is_integer if created from an arithmetical operation 2013-01-03 13:37:55 -08:00
stephen
190b9438c5 Add test/validation for is_numeric if created from an arithmetical operation 2013-01-03 13:37:55 -08:00
Jeff McCune
e1f2a93288 Update Modulefile, CHANGELOG for 3.2.0 2012-11-28 14:44:27 -08:00
Jeff McCune
1e5618c44f Merge branch '2.x' into 3.x
* 2.x:
  Update Modulefile, CHANGELOG for 2.6.0

Conflicts:
	CHANGELOG
	Modulefile
2012-11-28 14:39:29 -08:00
Jeff McCune
2b7591896d Update Modulefile, CHANGELOG for 2.6.0 2012-11-28 14:38:27 -08:00
Jeff McCune
16fe71867c Merge branch '2.x' into 3.x
* 2.x:
  Add reject() function
2012-11-28 14:29:14 -08:00
Jeff McCune
26819f9688 Merge branch 'duritong-fun/2.x/reject' into 2.x
* duritong-fun/2.x/reject:
  Add reject() function
2012-11-28 14:29:01 -08:00
Peter Meier
a79b2cdf43 Add reject() function
Like the grep function, but we can now reject members of an array
based on a pattern.
2012-11-28 14:28:31 -08:00
Jeff McCune
be6d456325 Merge branch '2.x' into 3.x
* 2.x:
  Revert "(Maint) Add spec/functions to rake test task"

Conflicts:
	Rakefile
2012-11-27 17:08:12 -08:00
Jeff McCune
59cc85deb5 Revert "(Maint) Add spec/functions to rake test task"
This reverts commit dbe3c8ecf6.

Because testing these against Puppet 2.6.x is causing failures.  These
need to be cleaned up, but I want to leave and this was the behavior
before I tried to "fix" it.
2012-11-27 17:06:29 -08:00
Jeff McCune
aa1e743e38 Merge branch '2.x' into 3.x
* 2.x:
  (Maint) Add spec/functions to rake test task
  Add example behaviors for ensure_packages() function
  Add an ensure_packages function.

Conflicts:
	Rakefile
2012-11-27 16:22:11 -08:00
Jeff McCune
965245eb97 Merge branch 'metcalfc/2.x/ensure_packages' into 2.x
* metcalfc/2.x/ensure_packages:
  (Maint) Add spec/functions to rake test task
  Add example behaviors for ensure_packages() function
  Add an ensure_packages function.
2012-11-27 16:19:52 -08:00
Jeff McCune
dbe3c8ecf6 (Maint) Add spec/functions to rake test task
Without this patch the `test` rake task does not exercise the
rspec-puppet behaviors located in spec/functions/  This is a
self-evident problem.

This patch fixes the problem by adding spec/functions to the list of
directories scanned for spec tests.
2012-11-27 16:18:07 -08:00
Jeff McCune
616b4521f4 Add example behaviors for ensure_packages() function
Without this patch the ensure_packages() function has no rspec behavior
examples.  This patch fixes the problem by filling out a spec file with
expected behaviors I could think of.
2012-11-27 16:16:28 -08:00
Chad Metcalf
8a8c09ed34 Add an ensure_packages function.
Its often the case that modules need to install a handful of packages.
In some cases its worth breaking these dependencies out into their own
modules (e.g., Java). In others it makes more sense to keep them in the
module. This can be problematic when multiple modules depend on common
packages (git, python ruby, etc). ensure_resource was a good first step
towards solving this problem. ensure_resource does not handle arrays and
for 3 or more packages stamping out ensure_resource declarations is
tedious.

ensure_packages is a convenience function that takes an array of packages
and wraps calls to ensure_resource. Currently users cannot specify
package versions. But the function could be extended to use a hash if
that functionality would be useful.
2012-11-27 16:16:28 -08:00
Jeff McCune
276abac257 Merge branch '2.x' into 3.x
* 2.x:
  (#17797) min() and max() functions
2012-11-26 16:34:04 -08:00
Jeff McCune
6f76d8dfd1 Merge branch 'fun/2.x/min_max' into 2.x
* fun/2.x/min_max:
  (#17797) min() and max() functions
2012-11-26 16:33:56 -08:00
Erik Dalén
9954133844 (#17797) min() and max() functions
returns the min or max of all arguments given to them
2012-11-26 16:33:44 -08:00
Jeff McCune
0648148bfb Merge branch '2.x' into 3.x
* 2.x:
  (#14670) Fixup file_line autorequire specs
  (#14670) autorequire a file_line resource's path
2012-11-26 11:41:01 -08:00
Jeff McCune
b55994b2be Merge branch 'fun/2.x/14670_file_line_autorequire' into 2.x
* fun/2.x/14670_file_line_autorequire:
  (#14670) Fixup file_line autorequire specs
  (#14670) autorequire a file_line resource's path
2012-11-26 11:39:26 -08:00
Jeff McCune
d8cde95295 (#14670) Fixup file_line autorequire specs
Without this patch applied the file_line autorequire examples are
failing.  This is a problem because the failures are false positives and
should be passing given the implementation.

This patch fixes the problem by changing the examples to directly test
the existence of the relationship by finding it in the list of
autorequire relationships.
2012-11-26 11:37:08 -08:00
Peter Meier
dfcee63afb (#14670) autorequire a file_line resource's path
If we manage a file we edit with file_line, it should be autorequired by
file_line.  Without this patch applied the relationship is not
automatically setup and the user is forced to manually manage the
relationship.
2012-11-26 10:35:18 -08:00
Jeff McCune
ad262b56a4 Merge branch '2.x' into 3.x
* 2.x:
  Add join_keys_to_values function
2012-11-20 16:16:50 -05:00
Jeff McCune
6c104e5e3a Merge branch 'lifton-feature/2.x/join_keys_to_values_function' into 2.x
* lifton-feature/2.x/join_keys_to_values_function:
  Add join_keys_to_values function
2012-11-20 16:16:37 -05:00
Joshua Harlan Lifton
ee0f2b307d Add join_keys_to_values function
This commit adds a function that joins each of a hash's keys with that
key's corresponding value, separated by a separator string. The
arguments are a hash and separator string. The return value is an
array of joined key/value pairs.
2012-11-20 16:16:03 -05:00
Jeff McCune
824ea6d49f Merge branch '2.x' into 3.x
* 2.x:
  Extend delete function for strings and hashes
  Fixed typo
2012-11-19 08:45:31 -05:00
Jeff McCune
6c36b494a0 Merge branch 'lifton-feature/2.x/extend_delete_function' into 2.x
* lifton-feature/2.x/extend_delete_function:
  Extend delete function for strings and hashes
  Fixed typo
2012-11-19 08:45:18 -05:00
Joshua Harlan Lifton
7322e4dc2f Extend delete function for strings and hashes
Previous to this commit, the delete function only acted on
arrays. This commit adds the same functionality for hashes and strings
in the obvious way: delete(h, k) would delete the k key from the h
hash and delete(s, sub) would delete all instances of the sub
substring from the s string.
2012-11-19 08:44:44 -05:00
Joshua Harlan Lifton
0798059361 Fixed typo 2012-11-19 08:44:44 -05:00
Jeff McCune
5353cd77b7 Merge branch '2.x' into 3.x
* 2.x:
  Add the pick() function
2012-11-15 08:57:21 -05:00
Jeff McCune
43dd606982 Merge branch 'feature/2.x/pick' into 2.x
* feature/2.x/pick:
  Add the pick() function
2012-11-15 08:56:52 -05:00
Gary Larizza
ba6dd13990 Add the pick() function
This function is similar to a coalesce function in SQL in that it will
return
the first value in a list of values that is not undefined or an empty
string
(two things in Puppet that will return a boolean false value).
Typically,
this function is used to check for a value in the Puppet
Dashboard/Enterprise
Console, and failover to a default value like the following:

  $real_jenkins_version = pick($::jenkins_version, '1.449')

The value of $real_jenkins_version will first look for a top-scope
variable
called 'jenkins_version' (note that parameters set in the Puppet
Dashboard/
Enterprise Console are brought into Puppet as top-scope variables), and,
failing that, will use a default value of 1.449.
2012-11-15 08:52:19 -05:00
Jeff McCune
b97e053cad Merge branch '2.x' into 3.x
* 2.x:
  (#13974) Add predicate functions for interface facts
2012-11-07 14:03:22 -08:00
Jeff McCune
f8635584a8 Merge branch 'add/2.x/13974-has_interface_with' into 2.x
* add/2.x/13974-has_interface_with:
  (#13974) Add predicate functions for interface facts
2012-11-07 14:03:08 -08:00
Wil Cooley
f8194176dc (#13974) Add predicate functions for interface facts
If one wishes to test if a host has a particular IP address (such as a floating
virtual address) or has an interface on a particular network (such as a
secondary management network), the facts that provide this information are
difficult to use within Puppet.

This patch addresses these needs by implementing functions
‘has_ip_address(value)’ and ‘has_ip_network(value)’. These functions look
through all interfaces for ipaddress_<interface> and network_<interface>
(respectively) having the requested <value>.

These functions are implemented on top of a lower-level predicate
function, ‘has_interface_with(kind, value)’, which iterates through the
interfaces in the ‘interfaces’ fact and checks the facts <kind>_<interface>
looking for <value>.

Additionally, the existence of a particular named interface can be checked for
by calling with only a single argument: has_interface_with(interface).

A Boolean is returned in all cases.
2012-11-07 14:00:44 -08:00
Jeff McCune
be71219f12 Merge branch '2.x' into 3.x
* 2.x:
  Add function, uriescape, to URI.escape strings. Redmine #17459
2012-11-07 09:43:52 -08:00