Commit graph

589 commits

Author SHA1 Message Date
Jeff McCune
cc670fb3b1 Merge branch '2.5.x' into 2.x
* 2.5.x:
  Update Modulefile, CHANGELOG for 2.5.1
2012-10-25 15:53:40 -07:00
Jeff McCune
1bb4c7a79e Update Modulefile, CHANGELOG for 2.5.1 2012-10-25 15:51:23 -07:00
Jeff McCune
aa22cded08 Merge branch '4.x'
* 4.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
2012-10-25 15:48:01 -07:00
Jeff McCune
18212dca01 Merge branch '3.x' into 4.x
* 3.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
2012-10-25 15:47:53 -07:00
Jeff McCune
9cc15a650a 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
2012-10-25 15:47:48 -07:00
Jeff McCune
614b3fbf6c Merge branch '2.5.x' into 3.1.x
* 2.5.x:
  (maint) Fix spec failures resulting from Facter API changes
2012-10-25 15:47:25 -07:00
Jeff McCune
43729e6ea9 Revert "Revert "Merge branch '2.5.x' into 3.0.x""
This reverts commit 9e8c60a8b7.

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...  =)
2012-10-25 15:44:14 -07:00
Jeff McCune
2ce2c5bd8d Merge branch '3.0.x' into 3.1.x
* 3.0.x:
  Revert "Merge branch '2.5.x' into 3.0.x"
2012-10-25 15:43:51 -07:00
Jeff McCune
9e8c60a8b7 Revert "Merge branch '2.5.x' into 3.0.x"
This reverts commit c8c7afc7a0, reversing
changes made to 03ec16e291.

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.
2012-10-25 15:42:05 -07:00
Jeff McCune
f7baf36750 Merge branch '2.5.x' into 2.x
* 2.5.x:
  (maint) Fix spec failures resulting from Facter API changes
2012-10-25 15:39:27 -07:00
Jeff McCune
3f310ec874 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
2012-10-25 15:38:50 -07:00
Jeff McCune
97f836f41b (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.
2012-10-25 15:36:54 -07:00
Jeff McCune
efb0a85b41 Merge branch '4.x'
* 4.x:
2012-10-25 12:01:46 -07:00
Jeff McCune
81b1f1b376 Merge branch '3.x' into 4.x
* 3.x:
2012-10-25 12:01:36 -07:00
Jeff McCune
4004a758b0 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'""
2012-10-25 12:01:01 -07:00
Jeff McCune
1d371ab8b6 Merge branch '3.0.x' into 3.1.x
* 3.0.x:

Conflicts:
	CHANGELOG
	Modulefile
2012-10-25 12:00:28 -07:00
Jeff McCune
c8c7afc7a0 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
2012-10-25 11:59:02 -07:00
Jeff McCune
f2143e0816 Merge branch '4.x'
* 4.x:
  Update Modulefile, CHANGELOG for 3.1.0
2012-10-25 11:33:50 -07:00
Jeff McCune
aa3bded3dd Merge branch '3.1.x' into 4.x
* 3.1.x:
  Update Modulefile, CHANGELOG for 3.1.0
2012-10-25 11:33:43 -07:00
Jeff McCune
e8fb678c91 Update Modulefile, CHANGELOG for 3.1.0 2012-10-25 11:33:09 -07:00
Jeff McCune
0879388845 Merge branch '4.x'
* 4.x:
  Revert "Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'""""
  Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"""
2012-10-25 11:29:38 -07:00
Jeff McCune
48b3e3b8ea Revert "Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'""""
This reverts commit 2885d314b6.

No, really.  Keep the !@#$% integration branches around so we don't have
this revert nightmare again.
2012-10-25 11:29:07 -07:00
Jeff McCune
f531a2936e Merge branch '3.1.x'
* 3.1.x:
  Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"""
2012-10-25 11:26:19 -07:00
Jeff McCune
2885d314b6 Revert "Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"""
This reverts commit 8fc00ea5b6.

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.
2012-10-25 11:20:50 -07:00
Jeff McCune
7d8df4b998 Merge branch '2.5.x'
* 2.5.x:
  Update Modulefile, CHANGELOG for 2.5.0

Conflicts:
	CHANGELOG
	Modulefile
2012-10-25 11:11:11 -07:00
Jeff McCune
88af331b0e Update Modulefile, CHANGELOG for 2.5.0 2012-10-25 11:03:27 -07:00
Jeff McCune
a748735f46 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
2012-10-25 10:59:13 -07:00
Jeff McCune
12a146058e 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
2012-10-25 10:58:27 -07:00
Jeff McCune
c2573298a5 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
2012-10-25 10:57:45 -07:00
Dan Bode
9fc3063ea9 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.
2012-10-25 10:57:40 -07:00
Jeff McCune
699d520e72 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
2012-10-25 10:54:39 -07:00
Dan Bode
444393bf6b re-formatting
This commit refactors to ensure 80 character lines.
2012-10-25 10:54:33 -07:00
Dan Bode
97d327ae44 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.
2012-10-25 10:54:33 -07:00
Dan Bode
4f8b133917 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 []
2012-10-25 10:54:33 -07:00
Dan Bode
a0cb8cdee4 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.
2012-10-25 10:54:33 -07:00
Jeff McCune
937096cdca Merge branch '2.5.x'
* 2.5.x:
  Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
2012-10-25 10:47:59 -07:00
Jeff McCune
9693c04c9d Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
This reverts commit d6d23b495c.

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.
2012-10-25 10:46:57 -07:00
Jeff McCune
ee05c32e49 Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""
This reverts commit d6d23b495c.

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.
2012-10-25 10:43:51 -07:00
Jeff McCune
43c80e800d Merge branch '2.4.x'
* 2.4.x:
  Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"
2012-10-25 10:43:11 -07:00
Jeff McCune
d6d23b495c Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"
This reverts commit 74e6411157, reversing
changes made to 417d219aa6.

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.
2012-10-25 10:41:52 -07:00
Jeff McCune
b8a0f28172 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
2012-10-25 10:30:14 -07:00
Jeff McCune
74e6411157 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
2012-10-25 10:06:02 -07:00
Jeff McCune
e68677976b 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.
2012-10-25 10:00:45 -07:00
Jeff McCune
ba70a3885a (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.
2012-10-24 17:23:42 -07:00
Matthaus Owens
4442f1edb5 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.
2012-10-24 17:23:42 -07:00
Matthaus Owens
cdf3b05f35 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.
2012-10-24 17:23:42 -07:00
Jeff McCune
6961179007 Merge branch '3.x'
* 3.x:
  (Maint) Remove core function documentation from README

Conflicts:
	README.markdown
2012-08-30 14:57:55 -07:00
Jeff McCune
fb8993bf48 Merge branch '3.0.x' into 3.x
* 3.0.x:
  (Maint) Remove core function documentation from README
2012-08-30 14:57:00 -07:00
Jeff McCune
03ec16e291 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
2012-08-30 14:54:52 -07:00
Jeff McCune
c761b32e0a (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.
2012-08-30 14:50:00 -07:00