]> gitweb.fluxo.info Git - puppet-stdlib.git/log
puppet-stdlib.git
13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Wed, 28 Nov 2012 01:08:12 +0000 (17:08 -0800)]
Merge branch '2.x' into 3.x

* 2.x:
  Revert "(Maint) Add spec/functions to rake test task"

Conflicts:
Rakefile

13 years agoRevert "(Maint) Add spec/functions to rake test task"
Jeff McCune [Wed, 28 Nov 2012 01:06:29 +0000 (17:06 -0800)]
Revert "(Maint) Add spec/functions to rake test task"

This reverts commit dbe3c8ecf6379963f583ea11e51e403e5ad55002.

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.

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Wed, 28 Nov 2012 00:22:11 +0000 (16:22 -0800)]
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

13 years agoMerge branch 'metcalfc/2.x/ensure_packages' into 2.x
Jeff McCune [Wed, 28 Nov 2012 00:19:52 +0000 (16:19 -0800)]
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.

13 years ago(Maint) Add spec/functions to rake test task
Jeff McCune [Wed, 28 Nov 2012 00:18:07 +0000 (16:18 -0800)]
(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.

13 years agoAdd example behaviors for ensure_packages() function
Jeff McCune [Wed, 28 Nov 2012 00:15:32 +0000 (16:15 -0800)]
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.

13 years agoAdd an ensure_packages function.
Chad Metcalf [Tue, 18 Sep 2012 18:43:30 +0000 (11:43 -0700)]
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.

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Tue, 27 Nov 2012 00:34:04 +0000 (16:34 -0800)]
Merge branch '2.x' into 3.x

* 2.x:
  (#17797) min() and max() functions

13 years agoMerge branch 'fun/2.x/min_max' into 2.x
Jeff McCune [Tue, 27 Nov 2012 00:33:56 +0000 (16:33 -0800)]
Merge branch 'fun/2.x/min_max' into 2.x

* fun/2.x/min_max:
  (#17797) min() and max() functions

13 years ago(#17797) min() and max() functions
Erik Dalén [Fri, 23 Nov 2012 16:00:04 +0000 (17:00 +0100)]
(#17797) min() and max() functions

returns the min or max of all arguments given to them

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Mon, 26 Nov 2012 19:41:01 +0000 (11:41 -0800)]
Merge branch '2.x' into 3.x

* 2.x:
  (#14670) Fixup file_line autorequire specs
  (#14670) autorequire a file_line resource's path

13 years agoMerge branch 'fun/2.x/14670_file_line_autorequire' into 2.x
Jeff McCune [Mon, 26 Nov 2012 19:39:26 +0000 (11:39 -0800)]
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

13 years ago(#14670) Fixup file_line autorequire specs
Jeff McCune [Mon, 26 Nov 2012 19:37:08 +0000 (11:37 -0800)]
(#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.

13 years ago(#14670) autorequire a file_line resource's path
Peter Meier [Wed, 23 May 2012 19:42:07 +0000 (21:42 +0200)]
(#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.

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Tue, 20 Nov 2012 21:16:50 +0000 (16:16 -0500)]
Merge branch '2.x' into 3.x

* 2.x:
  Add join_keys_to_values function

13 years agoMerge branch 'lifton-feature/2.x/join_keys_to_values_function' into 2.x
Jeff McCune [Tue, 20 Nov 2012 21:16:37 +0000 (16:16 -0500)]
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

13 years agoAdd join_keys_to_values function
Joshua Harlan Lifton [Tue, 20 Nov 2012 03:23:27 +0000 (19:23 -0800)]
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.

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Mon, 19 Nov 2012 13:45:31 +0000 (08:45 -0500)]
Merge branch '2.x' into 3.x

* 2.x:
  Extend delete function for strings and hashes
  Fixed typo

13 years agoMerge branch 'lifton-feature/2.x/extend_delete_function' into 2.x
Jeff McCune [Mon, 19 Nov 2012 13:45:18 +0000 (08:45 -0500)]
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

13 years agoExtend delete function for strings and hashes
Joshua Harlan Lifton [Sun, 18 Nov 2012 06:27:15 +0000 (22:27 -0800)]
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.

13 years agoFixed typo
Joshua Harlan Lifton [Sun, 18 Nov 2012 06:26:57 +0000 (22:26 -0800)]
Fixed typo

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Thu, 15 Nov 2012 13:57:21 +0000 (08:57 -0500)]
Merge branch '2.x' into 3.x

* 2.x:
  Add the pick() function

13 years agoMerge branch 'feature/2.x/pick' into 2.x
Jeff McCune [Thu, 15 Nov 2012 13:56:52 +0000 (08:56 -0500)]
Merge branch 'feature/2.x/pick' into 2.x

* feature/2.x/pick:
  Add the pick() function

13 years agoAdd the pick() function
Gary Larizza [Fri, 3 Aug 2012 22:46:26 +0000 (15:46 -0700)]
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.

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Wed, 7 Nov 2012 22:03:22 +0000 (14:03 -0800)]
Merge branch '2.x' into 3.x

* 2.x:
  (#13974) Add predicate functions for interface facts

13 years agoMerge branch 'add/2.x/13974-has_interface_with' into 2.x
Jeff McCune [Wed, 7 Nov 2012 22:03:08 +0000 (14:03 -0800)]
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

13 years ago(#13974) Add predicate functions for interface facts
Wil Cooley [Wed, 21 Mar 2012 05:21:53 +0000 (22:21 -0700)]
(#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.

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Wed, 7 Nov 2012 17:43:52 +0000 (09:43 -0800)]
Merge branch '2.x' into 3.x

* 2.x:
  Add function, uriescape, to URI.escape strings. Redmine #17459

13 years agoMerge branch 'add/3.x/joejulian-add_uriescape' into 3.x
Jeff McCune [Wed, 7 Nov 2012 17:43:47 +0000 (09:43 -0800)]
Merge branch 'add/3.x/joejulian-add_uriescape' into 3.x

* add/3.x/joejulian-add_uriescape:
  Add function, uriescape, to URI.escape strings. Redmine #17459

13 years agoMerge branch 'add/2.x/joejulian-add_uriescape' into 2.x
Jeff McCune [Wed, 7 Nov 2012 17:40:37 +0000 (09:40 -0800)]
Merge branch 'add/2.x/joejulian-add_uriescape' into 2.x

* add/2.x/joejulian-add_uriescape:
  Add function, uriescape, to URI.escape strings. Redmine #17459

13 years agoAdd function, uriescape, to URI.escape strings. Redmine #17459
Joe Julian [Wed, 7 Nov 2012 00:17:57 +0000 (16:17 -0800)]
Add function, uriescape, to URI.escape strings. Redmine #17459

13 years agoAdd function, uriescape, to URI.escape strings. Redmine #17459
Joe Julian [Wed, 7 Nov 2012 00:17:57 +0000 (16:17 -0800)]
Add function, uriescape, to URI.escape strings. Redmine #17459

13 years agoMerge branch '3.1.x' into 3.x
Jeff McCune [Thu, 25 Oct 2012 23:06:29 +0000 (16:06 -0700)]
Merge branch '3.1.x' into 3.x

* 3.1.x:
  Update CHANGELOG, Modulefile for 3.1.1

13 years agoUpdate CHANGELOG, Modulefile for 3.1.1
Jeff McCune [Thu, 25 Oct 2012 23:06:25 +0000 (16:06 -0700)]
Update CHANGELOG, Modulefile for 3.1.1

13 years agoMerge branch '2.x' into 3.x
Jeff McCune [Thu, 25 Oct 2012 22:54:51 +0000 (15:54 -0700)]
Merge branch '2.x' into 3.x

* 2.x:
  Update Modulefile, CHANGELOG for 2.5.1

Conflicts:
CHANGELOG
Modulefile

13 years agoMerge branch '2.5.x' into 2.x
Jeff McCune [Thu, 25 Oct 2012 22:53:40 +0000 (15:53 -0700)]
Merge branch '2.5.x' into 2.x

* 2.5.x:
  Update Modulefile, CHANGELOG for 2.5.1

13 years agoUpdate Modulefile, CHANGELOG for 2.5.1
Jeff McCune [Thu, 25 Oct 2012 22:51:23 +0000 (15:51 -0700)]
Update Modulefile, CHANGELOG for 2.5.1

13 years agoMerge branch '3.1.x' into 3.x
Jeff McCune [Thu, 25 Oct 2012 22:47:48 +0000 (15:47 -0700)]
Merge branch '3.1.x' into 3.x

* 3.1.x:
  Revert "Revert "Merge branch '2.5.x' into 3.0.x""
  Revert "Merge branch '2.5.x' into 3.0.x"
  (maint) Fix spec failures resulting from Facter API changes

13 years agoMerge branch '2.5.x' into 3.1.x
Jeff McCune [Thu, 25 Oct 2012 22:47:25 +0000 (15:47 -0700)]
Merge branch '2.5.x' into 3.1.x

* 2.5.x:
  (maint) Fix spec failures resulting from Facter API changes

13 years agoRevert "Revert "Merge branch '2.5.x' into 3.0.x""
Jeff McCune [Thu, 25 Oct 2012 22:44:14 +0000 (15:44 -0700)]
Revert "Revert "Merge branch '2.5.x' into 3.0.x""

This reverts commit 9e8c60a8b73fd96393b08d690c7197e62aae623e.

This was an error on my part.  3.1.x descends from 3.0.x _and_ 2.5.x, but 3.0.x does
not descend from 2.5.x.  I should not have merged 2.5.x into 3.0.x,
instead I should have merged 2.5.x into 3.1.x skipping over the 3.0.x
merge up.

I'm slowly starting to understand the implications of semver on our
branching strategy...  =)

13 years agoMerge branch '3.0.x' into 3.1.x
Jeff McCune [Thu, 25 Oct 2012 22:43:51 +0000 (15:43 -0700)]
Merge branch '3.0.x' into 3.1.x

* 3.0.x:
  Revert "Merge branch '2.5.x' into 3.0.x"

13 years agoRevert "Merge branch '2.5.x' into 3.0.x"
Jeff McCune [Thu, 25 Oct 2012 22:42:05 +0000 (15:42 -0700)]
Revert "Merge branch '2.5.x' into 3.0.x"

This reverts commit c8c7afc7a00aaeeddea6514d9fe9508513e53a73, reversing
changes made to 03ec16e291a70ac5ac412be36ae3b86a771b98af.

This was a mistake on my part.  2.5 is a minor release and minor
releases should never be merged into patch level branches.  2.5.x should
have been merged into 3.1.x instead.

13 years agoMerge branch '2.5.x' into 2.x
Jeff McCune [Thu, 25 Oct 2012 22:39:27 +0000 (15:39 -0700)]
Merge branch '2.5.x' into 2.x

* 2.5.x:
  (maint) Fix spec failures resulting from Facter API changes

13 years agoMerge branch 'fix/2.5.x/facter_loader' into 2.5.x
Jeff McCune [Thu, 25 Oct 2012 22:38:50 +0000 (15:38 -0700)]
Merge branch 'fix/2.5.x/facter_loader' into 2.5.x

* fix/2.5.x/facter_loader:
  (maint) Fix spec failures resulting from Facter API changes

13 years ago(maint) Fix spec failures resulting from Facter API changes
Jeff McCune [Thu, 25 Oct 2012 22:32:34 +0000 (15:32 -0700)]
(maint) Fix spec failures resulting from Facter API changes

Without this patch stdlib tests fail against Facter 2.x and master but
not 1.6.x.

This patch fixes the problem by initializing the example group
differently depending on the version of Facter integrating into the
system.  The adjusted methods are:

 1.x - Facter.collection.loader.load
 2.x - Facter.collection.load

The collection actually implements the load method in both version, it's
simply marked as private in 1.x.

13 years agoMerge branch '3.1.x' into 3.x
Jeff McCune [Thu, 25 Oct 2012 19:01:01 +0000 (12:01 -0700)]
Merge branch '3.1.x' into 3.x

* 3.1.x:
  Update Modulefile, CHANGELOG for 3.1.0
  Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"""
  Update Modulefile, CHANGELOG for 2.5.0
  Explicitly load functions used by ensure_resource
  re-formatting
  Add better docs about duplicate resource failures
  Handle undef for parameter argument
  Add function ensure_resource and defined_with_params
  Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
  Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
  Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"
  Prevent undefined method `split' for nil:NilClass with pe_foo_version facts
  (maint) Clear all facts before each example
  Add spec tests for pe_version facts
  Add PE facts to stdlib
  Fix some logical inconsistencies in README
  (#14422) Update README to include the bug tracker URL.
  Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'""

13 years agoMerge branch '3.0.x' into 3.1.x
Jeff McCune [Thu, 25 Oct 2012 19:00:28 +0000 (12:00 -0700)]
Merge branch '3.0.x' into 3.1.x

* 3.0.x:

Conflicts:
CHANGELOG
Modulefile

13 years agoMerge branch '2.5.x' into 3.0.x
Jeff McCune [Thu, 25 Oct 2012 18:59:02 +0000 (11:59 -0700)]
Merge branch '2.5.x' into 3.0.x

* 2.5.x:
  Update Modulefile, CHANGELOG for 2.5.0
  Explicitly load functions used by ensure_resource
  re-formatting
  Add better docs about duplicate resource failures
  Handle undef for parameter argument
  Add function ensure_resource and defined_with_params
  Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
  Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"
  Prevent undefined method `split' for nil:NilClass with pe_foo_version facts
  (maint) Clear all facts before each example
  Add spec tests for pe_version facts
  Add PE facts to stdlib

Conflicts:
CHANGELOG
Modulefile
spec/spec_helper.rb

13 years agoUpdate Modulefile, CHANGELOG for 3.1.0
Jeff McCune [Thu, 25 Oct 2012 18:33:09 +0000 (11:33 -0700)]
Update Modulefile, CHANGELOG for 3.1.0

13 years agoRevert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"""
Jeff McCune [Thu, 25 Oct 2012 18:20:50 +0000 (11:20 -0700)]
Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"""

This reverts commit 8fc00ea5b6b39b220ebc6391489915dbeeb364ab.

I really wish we could get this right.

Without this patch there is no branch that contains backwards-comaptible
new functionality relative to the current 3.0.1.  There are only
branches that contain backwards-incompatible functionality relative to
3.0.1.

This is a problem because I need to do a release of stdlib that contains
backwards compatible facts but does not contain any breaking changes.

This patch fixes the problem by establishing the 3.1.x branch.  This
branch will then revert the backwards incompatible changes from the
3.1.x branch and revert the revets in the 4.x and master branches.

I'll review our merge process, but it seems wrong that there is no place
to separate out incompatible from compatible changes when working beyond
the most recent patch release.

13 years agoMerge branch '2.5.x'
Jeff McCune [Thu, 25 Oct 2012 18:11:11 +0000 (11:11 -0700)]
Merge branch '2.5.x'

* 2.5.x:
  Update Modulefile, CHANGELOG for 2.5.0

Conflicts:
CHANGELOG
Modulefile

13 years agoUpdate Modulefile, CHANGELOG for 2.5.0
Jeff McCune [Thu, 25 Oct 2012 18:02:53 +0000 (11:02 -0700)]
Update Modulefile, CHANGELOG for 2.5.0

13 years agoMerge branch '2.5.x'
Jeff McCune [Thu, 25 Oct 2012 17:59:13 +0000 (10:59 -0700)]
Merge branch '2.5.x'

* 2.5.x:
  Explicitly load functions used by ensure_resource
  re-formatting
  Add better docs about duplicate resource failures
  Handle undef for parameter argument
  Add function ensure_resource and defined_with_params

13 years agoMerge branch 'maint/2.5.x/pick_compatible_new_functionality' into 2.5.x
Jeff McCune [Thu, 25 Oct 2012 17:58:27 +0000 (10:58 -0700)]
Merge branch 'maint/2.5.x/pick_compatible_new_functionality' into 2.5.x

* maint/2.5.x/pick_compatible_new_functionality:
  Explicitly load functions used by ensure_resource
  re-formatting
  Add better docs about duplicate resource failures
  Handle undef for parameter argument
  Add function ensure_resource and defined_with_params

13 years agoMerge branch 'maint/2.5.x/pick_explicitly_load_functions' into maint/2.5.x/pick_compa...
Jeff McCune [Thu, 25 Oct 2012 17:57:45 +0000 (10:57 -0700)]
Merge branch 'maint/2.5.x/pick_explicitly_load_functions' into maint/2.5.x/pick_compatible_new_functionality

* maint/2.5.x/pick_explicitly_load_functions:
  Explicitly load functions used by ensure_resource

13 years agoExplicitly load functions used by ensure_resource
Dan Bode [Wed, 15 Aug 2012 22:57:45 +0000 (15:57 -0700)]
Explicitly load functions used by ensure_resource

The ensure_resource function actually calls two
other functions, create_resources and defined_with_param.

When calling Puppet functions from Ruby, you sometimes have
to load the functions manually if they have not been called
before.

This commit explicitly loads the functions that ensure_resource
depends on from within the function.

13 years agoMerge branch 'maint/2.5.x/pick_pr86_ensure_resource' into maint/2.5.x/pick_compatible...
Jeff McCune [Thu, 25 Oct 2012 17:54:39 +0000 (10:54 -0700)]
Merge branch 'maint/2.5.x/pick_pr86_ensure_resource' into maint/2.5.x/pick_compatible_new_functionality

* maint/2.5.x/pick_pr86_ensure_resource:
  re-formatting
  Add better docs about duplicate resource failures
  Handle undef for parameter argument
  Add function ensure_resource and defined_with_params

13 years agore-formatting
Dan Bode [Tue, 14 Aug 2012 01:53:47 +0000 (18:53 -0700)]
re-formatting

This commit refactors to ensure 80 character lines.

13 years agoAdd better docs about duplicate resource failures
Dan Bode [Tue, 14 Aug 2012 01:52:56 +0000 (18:52 -0700)]
Add better docs about duplicate resource failures

This commit adds better inline documentation
explaining how replicate resource definitions can
occur if the resource exists and does not have
matching parameters.

13 years agoHandle undef for parameter argument
Dan Bode [Tue, 14 Aug 2012 01:52:00 +0000 (18:52 -0700)]
Handle undef for parameter argument

This commit adds better handling of the case where
undef is passed as the parameter value.

This works by converting '' into []

13 years agoAdd function ensure_resource and defined_with_params
Dan Bode [Wed, 8 Aug 2012 03:48:54 +0000 (20:48 -0700)]
Add function ensure_resource and defined_with_params

This commit adds 2 new functions with unit tests.

defined_with_params works similarily to puppet's defined
function, except it allows you to also specify a hash of
params. defined_with_params will return true if a resource
also exists that matches the specified type/title (just like
with defined) as well as all of the specified params.

ensure_resource is a function that basically combines defined_with_params
with create_resources to conditionally create resources only if the
specified resource (title, type, params) does not already exist.

These functions are created to serve as an alternative to using
defined as follows:

    if ! defined(Package['some_package']) {
      package { 'some_package': ensure => present,
    }

The issue with this usage is that there is no guarentee about
what parameters were set in the previous definition of the package
that made its way into the catalog.

ensure_resource could be used instead, as:

    ensure_resource('package', 'some_package', { 'ensure' => 'present' })

This will creat the package resources only if another resource does
not exist with the specified parameters.

13 years agoMerge branch '2.5.x'
Jeff McCune [Thu, 25 Oct 2012 17:47:59 +0000 (10:47 -0700)]
Merge branch '2.5.x'

* 2.5.x:
  Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""

13 years agoRevert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
Jeff McCune [Thu, 25 Oct 2012 17:46:57 +0000 (10:46 -0700)]
Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""

This reverts commit d6d23b495cda0e154b4e73982acc43e586564c0e.

This backwards-compatible additional functionality is targeted at the
next minor release.  There are already backwards-incompatible changes in
the master branch so we need to establish a new minor branch.

13 years agoRevert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
Jeff McCune [Thu, 25 Oct 2012 17:43:51 +0000 (10:43 -0700)]
Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""

This reverts commit d6d23b495cda0e154b4e73982acc43e586564c0e.

Why?  Because this change set should actually be in master and our
merge-up process reverted the change set in master when I reverted from
2.4.x.

This patch reverts the revert, restoring the original change set.

13 years agoMerge branch '2.4.x'
Jeff McCune [Thu, 25 Oct 2012 17:43:11 +0000 (10:43 -0700)]
Merge branch '2.4.x'

* 2.4.x:
  Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"

13 years agoRevert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"
Jeff McCune [Thu, 25 Oct 2012 17:41:52 +0000 (10:41 -0700)]
Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"

This reverts commit 74e6411157b8df1af9a24c17971e3236f3096529, reversing
changes made to 417d219aa6e42f2a16af42c98aa063fc1d9d2ecd.

Here's why:

Actually... I just screwed this up.

I merged this new fact into 2.4.x but it's not fixing any bug. It's adding a
new fact, so this should go into master and we should release 2.5 since this is
new, backwards-compatible functionality.

13 years agoMerge branch '2.4.x'
Jeff McCune [Thu, 25 Oct 2012 17:30:14 +0000 (10:30 -0700)]
Merge branch '2.4.x'

* 2.4.x:
  Prevent undefined method `split' for nil:NilClass with pe_foo_version facts
  (maint) Clear all facts before each example
  Add spec tests for pe_version facts
  Add PE facts to stdlib

Conflicts:
spec/spec_helper.rb

13 years agoMerge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x
Jeff McCune [Thu, 25 Oct 2012 17:06:02 +0000 (10:06 -0700)]
Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x

* haus-add_pe_facts_to_stdlib:
  Prevent undefined method `split' for nil:NilClass with pe_foo_version facts
  (maint) Clear all facts before each example
  Add spec tests for pe_version facts
  Add PE facts to stdlib

13 years agoPrevent undefined method `split' for nil:NilClass with pe_foo_version facts
Jeff McCune [Thu, 25 Oct 2012 17:00:42 +0000 (10:00 -0700)]
Prevent undefined method `split' for nil:NilClass with pe_foo_version facts

Without this patch the pe_major_version, pe_minor_version, and
pe_patch_version facts directly depend on the pe_version fact in a
manner that calls split directly on the return value.

This is a problem because Fact values are not always guaranteed to
return strings, or objects that respond to split.  This patch is a
defensive measure to ensure we're always calling the split method on a
string object.

If the Fact returns nil, this will be converted to an empty string
responding to split.

13 years ago(maint) Clear all facts before each example
Jeff McCune [Wed, 24 Oct 2012 23:59:43 +0000 (16:59 -0700)]
(maint) Clear all facts before each example

Without this patch example groups must explicitly call `Facter.clear` to
clear any cached values between examples.  This is a problem because
this behavior is not the concern of the example groups, the behavior is
the concern of the spec_helper or whatever facility we have in place to
initialize the system for testing.

This patch fixes the problem by duplicating the logic in the Facter
spec_helper to ensure facts are cleared out before each example.

This patch requires the example groups to explicitly load the facts they
require if the fact name does not match the filename.

13 years agoAdd spec tests for pe_version facts
Matthaus Owens [Tue, 23 Oct 2012 21:14:06 +0000 (14:14 -0700)]
Add spec tests for pe_version facts

This commit adds some basic spec tests for the pe_version facts. There are
basic postitive and negative cases.

13 years agoAdd PE facts to stdlib
Matthaus Owens [Tue, 23 Oct 2012 21:13:11 +0000 (14:13 -0700)]
Add PE facts to stdlib

As many PE modules have PE specific functionality, but are deployed to all
nodes, including FOSS nodes, it is valuable to be able to selectively enable
those PE specific functions. These facts allow modules to use the is_pe fact to
determine whether the module should be used or not. The facts include is_pe,
pe_version, pe_major_version, pe_minor_version, and pe_patch_version. For PE
2.6.0 those facts would have values true, 2.6.0, 2, 6, and 0, respectively.

13 years agoMerge branch '3.x'
Jeff McCune [Thu, 30 Aug 2012 21:57:55 +0000 (14:57 -0700)]
Merge branch '3.x'

* 3.x:
  (Maint) Remove core function documentation from README

Conflicts:
README.markdown

13 years agoMerge branch '3.0.x' into 3.x
Jeff McCune [Thu, 30 Aug 2012 21:57:00 +0000 (14:57 -0700)]
Merge branch '3.0.x' into 3.x

* 3.0.x:
  (Maint) Remove core function documentation from README

13 years agoMerge branch 'bug/3.0.x/remove_core_function_docs' into 3.0.x
Jeff McCune [Thu, 30 Aug 2012 21:54:52 +0000 (14:54 -0700)]
Merge branch 'bug/3.0.x/remove_core_function_docs' into 3.0.x

* bug/3.0.x/remove_core_function_docs:
  (Maint) Remove core function documentation from README

13 years ago(Maint) Remove core function documentation from README
Jeff McCune [Thu, 30 Aug 2012 21:50:00 +0000 (14:50 -0700)]
(Maint) Remove core function documentation from README

Without this patch the README contains the documentation for core
functions shipped in Puppet in addition to the functions shipped in
stdlib.

This is a problem because it's confusing for end users trying to get
started with puppet.

This patch makes it so only the stdlib functions are included.

13 years agoMerge pull request #93 from ptman/patch-1
Jeff McCune [Thu, 30 Aug 2012 16:40:56 +0000 (09:40 -0700)]
Merge pull request #93 from ptman/patch-1

Fix some logical inconsistencies in README

13 years agoFix some logical inconsistencies in README
Paul Tötterman [Thu, 30 Aug 2012 10:40:12 +0000 (13:40 +0300)]
Fix some logical inconsistencies in README

13 years agoMerge branch '3.x'
Jeff McCune [Mon, 20 Aug 2012 21:25:17 +0000 (14:25 -0700)]
Merge branch '3.x'

* 3.x:
  Disable tests that fail on 2.6.x due to #15912

13 years agoMerge branch '3.0.x' into 3.x
Jeff McCune [Mon, 20 Aug 2012 21:25:06 +0000 (14:25 -0700)]
Merge branch '3.0.x' into 3.x

* 3.0.x:
  Disable tests that fail on 2.6.x due to #15912

13 years agoMerge branch '2.4.x' into 3.0.x
Jeff McCune [Mon, 20 Aug 2012 21:24:52 +0000 (14:24 -0700)]
Merge branch '2.4.x' into 3.0.x

* 2.4.x:
  Disable tests that fail on 2.6.x due to #15912

13 years agoMerge branch '2.3.x' into 2.4.x
Jeff McCune [Mon, 20 Aug 2012 21:24:41 +0000 (14:24 -0700)]
Merge branch '2.3.x' into 2.4.x

* 2.3.x:
  Disable tests that fail on 2.6.x due to #15912

13 years agoMerge branch '2.2.x' into 2.3.x
Jeff McCune [Mon, 20 Aug 2012 21:24:23 +0000 (14:24 -0700)]
Merge branch '2.2.x' into 2.3.x

* 2.2.x:
  Disable tests that fail on 2.6.x due to #15912

13 years agoMerge branch '2.1.x' into 2.2.x
Jeff McCune [Mon, 20 Aug 2012 21:24:08 +0000 (14:24 -0700)]
Merge branch '2.1.x' into 2.2.x

* 2.1.x:
  Disable tests that fail on 2.6.x due to #15912

Conflicts:
spec/unit/puppet/parser/functions/getvar_spec.rb
spec/unit/puppet/parser/functions/has_key_spec.rb
spec/unit/puppet/parser/functions/merge_spec.rb

13 years agoMerge branch 'fix/2.1.x/disable_puppet26_failing_tests' into 2.1.x
Jeff McCune [Mon, 20 Aug 2012 21:22:40 +0000 (14:22 -0700)]
Merge branch 'fix/2.1.x/disable_puppet26_failing_tests' into 2.1.x

* fix/2.1.x/disable_puppet26_failing_tests:
  Disable tests that fail on 2.6.x due to #15912

13 years agoDisable tests that fail on 2.6.x due to #15912
Jeff McCune [Mon, 20 Aug 2012 21:21:12 +0000 (14:21 -0700)]
Disable tests that fail on 2.6.x due to #15912

In Puppet 2.6.x there is a bug where a function may be incorrectly detected as
an rvalue when it is not, or not detected when it is. This means that in tests
the correct syntax for calling a function will be rejected. This disables
those tests on 2.6.x, as there is no straightforward way to write them to be
compatible with both 2.6.x and newer versions of Puppet.

Conflicts:
spec/unit/puppet/parser/functions/getvar_spec.rb
spec/unit/puppet/parser/functions/has_key_spec.rb
spec/unit/puppet/parser/functions/merge_spec.rb

This patch was constructed by cherry-picking e27eccb and resolving the
merge conflicts to only include the `pending` statements.  This resolves
the problem by disabling these tests in Puppet 2.6.

13 years agoMerge branch '3.x'
Jeff McCune [Mon, 20 Aug 2012 21:05:42 +0000 (14:05 -0700)]
Merge branch '3.x'

* 3.x:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root

13 years agoMerge branch '3.0.x' into 3.x
Jeff McCune [Mon, 20 Aug 2012 21:05:35 +0000 (14:05 -0700)]
Merge branch '3.0.x' into 3.x

* 3.0.x:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root

13 years agoMerge branch '2.4.x' into 3.0.x
Jeff McCune [Mon, 20 Aug 2012 21:05:16 +0000 (14:05 -0700)]
Merge branch '2.4.x' into 3.0.x

* 2.4.x:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root

13 years agoMerge branch '2.3.x' into 2.4.x
Jeff McCune [Mon, 20 Aug 2012 21:04:15 +0000 (14:04 -0700)]
Merge branch '2.3.x' into 2.4.x

* 2.3.x:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root

13 years agoMerge branch '2.2.x' into 2.3.x
Jeff McCune [Mon, 20 Aug 2012 21:04:03 +0000 (14:04 -0700)]
Merge branch '2.2.x' into 2.3.x

* 2.2.x:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root

13 years agoMerge branch '2.1.x' into 2.2.x
Jeff McCune [Mon, 20 Aug 2012 21:03:48 +0000 (14:03 -0700)]
Merge branch '2.1.x' into 2.2.x

* 2.1.x:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root

Conflicts:
spec/unit/puppet/parser/functions/getvar_spec.rb
spec/unit/puppet/parser/functions/has_key_spec.rb
spec/unit/puppet/parser/functions/merge_spec.rb

13 years agoMerge branch 'fix/2.1.x/spec_failures' into 2.1.x
Jeff McCune [Mon, 20 Aug 2012 21:01:56 +0000 (14:01 -0700)]
Merge branch 'fix/2.1.x/spec_failures' into 2.1.x

* fix/2.1.x/spec_failures:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root

13 years ago(Maint) Fix mis-use of rvalue functions as statements
Jeff McCune [Mon, 20 Aug 2012 20:57:09 +0000 (13:57 -0700)]
(Maint) Fix mis-use of rvalue functions as statements

Without this patch applied the spec tests are invalid because they call
rvalue functions as if they were statements.  This is a problem because
Puppet 2.7.x currently throws an exception if a rvalue function is
invoked as if it were a statement function.  This exception from Puppet
is causing tests to fail.

This patch fixes the problem by changing the tests to assign the return
value of the functions to a variable.  This fixes the problem by
invoking the functions properly.

Paired-with: Andrew Parker <andy@puppetlabs.com>

13 years agoAdd .rspec file to repo root
Jeff McCune [Mon, 20 Aug 2012 18:49:45 +0000 (11:49 -0700)]
Add .rspec file to repo root

Without this patch we don't get an opinionated rspec behavior.  This
patch makes the behavior of `rake test` and `rspec spec/` opinionated
by including some default options.

13 years agoMerge branch '3.x'
Jeff McCune [Sun, 19 Aug 2012 23:29:22 +0000 (16:29 -0700)]
Merge branch '3.x'

* 3.x:
  (#14422) Update README to include the bug tracker URL.

13 years agoMerge branch '3.0.x' into 3.x
Jeff McCune [Sun, 19 Aug 2012 23:29:09 +0000 (16:29 -0700)]
Merge branch '3.0.x' into 3.x

* 3.0.x:
  (#14422) Update README to include the bug tracker URL.

13 years agoMerge branch 'fix/3.0.x/14422_readme' into 3.0.x
Jeff McCune [Sun, 19 Aug 2012 23:28:59 +0000 (16:28 -0700)]
Merge branch 'fix/3.0.x/14422_readme' into 3.0.x

* fix/3.0.x/14422_readme:
  (#14422) Update README to include the bug tracker URL.

13 years ago(#14422) Update README to include the bug tracker URL.
Eric Sorenson [Fri, 17 Aug 2012 22:15:26 +0000 (15:15 -0700)]
(#14422) Update README to include the bug tracker URL.

As reported, it is indeed difficult to navigate directly to the correct
part of Redmine for a particular sub-project. This commit puts the
issue tracker URL front and center.

13 years agoMerge pull request #90 from ahpook/14422_update_readme
Jeff McCune [Sun, 19 Aug 2012 23:24:59 +0000 (16:24 -0700)]
Merge pull request #90 from ahpook/14422_update_readme

(#14422) Update README to include the bug tracker URL.