Commit graph

451 commits

Author SHA1 Message Date
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
Jeff McCune
87092415fb Merge pull request #93 from ptman/patch-1
Fix some logical inconsistencies in README
2012-08-30 09:40:56 -07:00
Paul Tötterman
4169e77224 Fix some logical inconsistencies in README 2012-08-30 13:40:12 +03:00
Jeff McCune
4e25230dd3 Merge branch '3.x'
* 3.x:
  Disable tests that fail on 2.6.x due to #15912
2012-08-20 14:25:17 -07:00
Jeff McCune
5fcb972a83 Merge branch '3.0.x' into 3.x
* 3.0.x:
  Disable tests that fail on 2.6.x due to #15912
2012-08-20 14:25:06 -07:00
Jeff McCune
55b5e6885d Merge branch '2.4.x' into 3.0.x
* 2.4.x:
  Disable tests that fail on 2.6.x due to #15912
2012-08-20 14:24:52 -07:00
Jeff McCune
417d219aa6 Merge branch '2.3.x' into 2.4.x
* 2.3.x:
  Disable tests that fail on 2.6.x due to #15912
2012-08-20 14:24:41 -07:00
Jeff McCune
d2798b721a Merge branch '2.2.x' into 2.3.x
* 2.2.x:
  Disable tests that fail on 2.6.x due to #15912
2012-08-20 14:24:23 -07:00
Jeff McCune
73261f14ad 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
2012-08-20 14:24:08 -07:00
Jeff McCune
8fdd59547d 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
2012-08-20 14:22:40 -07:00
Jeff McCune
c81496ef5e 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.
2012-08-20 14:21:12 -07:00
Jeff McCune
c0639d06e1 Merge branch '3.x'
* 3.x:
  (Maint) Fix mis-use of rvalue functions as statements
  Add .rspec file to repo root
2012-08-20 14:05:42 -07:00
Jeff McCune
7a0e4be2e7 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
2012-08-20 14:05:35 -07:00
Jeff McCune
22935580be 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
2012-08-20 14:05:16 -07:00
Jeff McCune
0f45feb31b 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
2012-08-20 14:04:15 -07:00
Jeff McCune
607cb54275 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
2012-08-20 14:04:03 -07:00
Jeff McCune
a8a4f93992 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
2012-08-20 14:03:48 -07:00
Jeff McCune
3f44686f1c 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
2012-08-20 14:01:56 -07:00
Jeff McCune
44929130f9 (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>
2012-08-20 13:57:09 -07:00
Jeff McCune
88789e887c 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.
2012-08-20 11:49:45 -07:00
Jeff McCune
6319605891 Merge branch '3.x'
* 3.x:
  (#14422) Update README to include the bug tracker URL.
2012-08-19 16:29:22 -07:00
Jeff McCune
c121e45e03 Merge branch '3.0.x' into 3.x
* 3.0.x:
  (#14422) Update README to include the bug tracker URL.
2012-08-19 16:29:09 -07:00
Jeff McCune
039ea5ed83 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.
2012-08-19 16:28:59 -07:00
Eric Sorenson
258287941b (#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.
2012-08-19 16:28:32 -07:00
Jeff McCune
8e0b190e60 Merge pull request #90 from ahpook/14422_update_readme
(#14422) Update README to include the bug tracker URL.
2012-08-19 16:24:59 -07:00
Eric Sorenson
af22a40679 (#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.
2012-08-17 15:15:26 -07:00
Jeff McCune
8fc00ea5b6 Revert "Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'""
This reverts commit d3e30bcdc6.
2012-08-16 19:49:47 -07:00
Jeff McCune
44e99a7c00 Update CHANGELOG, Modulefile for 3.0.1 2012-08-16 19:47:32 -07:00
Jeff McCune
4ccb5e8d94 Merge branch 'fix/master/where_did_facts_dot_d_go'
* fix/master/where_did_facts_dot_d_go:
  Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"
2012-08-16 19:42:28 -07:00
Jeff McCune
d3e30bcdc6 Revert "Merge branch 'hkenney-ticket/master/2157_remove_facts_dot_d'"
This reverts commit cc414a422d, reversing
changes made to 29f8f89c19.

Conflicts:
	README.markdown

Without this patch, there is no facts_dot_d functionality and we don't
have it implemented in Facter 2.0.  This is a problem because Puppet
Enterprise and many users rely on facts.d support.  We're also backwards
compatible with Facter 1.6 in stdlib 3.0 so this is a bug fix.
2012-08-16 19:28:13 -07:00
Jeff McCune
f8ce04a753 Merge branch 'release/master/three_dot_oh_dot_oh'
* release/master/three_dot_oh_dot_oh:
  Update CHANGELOG, Modulefile for 3.0.0
  (Maint) Update README for 3.0.0
2012-08-16 11:02:55 -07:00
Jeff McCune
cf18f61581 Update CHANGELOG, Modulefile for 3.0.0 2012-08-16 11:01:09 -07:00
Jeff McCune
436ba53168 (Maint) Update README for 3.0.0
This commit updates the README for 3.0.0 by taking a function list
produced with `puppet doc -r function` _without_ stdlib in the
`$LOAD_PATH` and then filtering out the native functions by executing
`puppet doc -r function` _with_ stdlib/lib in the `$LOAD_PATH` and then
running `comm -13 core_functions.txt all_functions.txt`
2012-08-16 10:59:31 -07:00
Jeff McCune
1e9db532e6 Merge branch 'bodepd-ensure_resource_attempt_2'
* bodepd-ensure_resource_attempt_2:
  Explicitly load functions used by ensure_resource
  Revert "Revert "Merge pull request #86 from bodepd/ensure_resource""
2012-08-16 10:41:23 -07:00
Dan Bode
5d99cdf09c 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-08-15 15:57:45 -07:00
Dan Bode
b42c82af19 Revert "Revert "Merge pull request #86 from bodepd/ensure_resource""
This reverts commit 1e09833624.
2012-08-15 15:56:57 -07:00
Jeff McCune
1e09833624 Revert "Merge pull request #86 from bodepd/ensure_resource"
This reverts commit 42ddd7fe54, reversing
changes made to 53243605b2.
2012-08-14 18:26:17 -07:00
Jeff McCune
42ddd7fe54 Merge pull request #86 from bodepd/ensure_resource
Add function ensure_resource and defined_with_params
2012-08-14 18:11:15 -07:00
Jeff McCune
53243605b2 Merge branch '2.4.x'
* 2.4.x:
  Update Modulefile, CHANGELOG for 2.4.0
2012-08-14 15:08:13 -07:00