Commit graph

1476 commits

Author SHA1 Message Date
David Schmitt
bfa21edbae (FM-3701) Update README for is_a 2015-09-28 11:12:25 +01:00
David Schmitt
39e81aa8b5 Merge pull request #531 from asasfu/improvement/service_provider_fact
fixup-PR#506 Speed improvements in facter resolution
2015-09-28 10:09:17 +01:00
Adam S
440245d40d fixup-PR#506 Speed improvements in facter resolution
This is to improve speed on Facter resolution of service_provider fact
that was just introduced in PR# 506.  The improvements go from 280ms
resolution time approx. down to 2ms resolution time approx. by adding
requires statements.
2015-09-25 18:06:00 -07:00
Adam S
ce6e8679b6 Add package_provider fact
This adds a package_provider fact for situations where we need to be
able to know the client's package provider in a simple way.  Situations
such as: package { 'name': install_options => [] }  As those tend to be
package provider specific options.
2015-09-25 17:55:21 -07:00
Hunter Haugen
4d1bca3359 Merge pull request #506 from binford2k/feature/service_provider_fact
Add a service_provider fact
2015-09-24 10:55:39 -07:00
David Schmitt
6bb1c27b99 Merge pull request #530 from HelenCampbell/MODULES-2614
Adding update to empty function readme
2015-09-23 11:38:53 +01:00
Helen Campbell
92b068ad20 Adding update to empty function readme 2015-09-23 11:27:48 +01:00
Bryan Jen
cebb9f333f Merge pull request #528 from mhaskel/is_a_fixes
Update is_a acceptance tests to only run on puppet4
2015-09-21 16:33:22 -07:00
Morgan Haskel
b20239e796 Update is_a acceptance tests to only run on puppet4 2015-09-21 14:12:25 -07:00
Bryan Jen
97bd656efb Merge pull request #527 from mhaskel/511_compatibility
Fix backwards compatibility from #511
2015-09-21 11:20:35 -07:00
Morgan Haskel
799c38e14e Fix backwards compatibility from #511
Maintain the old behavior in the case where the optional second
parameter isn't passed. Also, adding arity is backwards incompatible since
stdlib still supports 2.7, so remove that.
2015-09-21 11:11:21 -07:00
Hunter Haugen
9b1932c538 Merge pull request #526 from DavidS/improve-validate_re-docs
(MAINT) validate_re: Clarify docs and error message
2015-09-17 12:12:12 -07:00
David Schmitt
55ece7815a (MAINT) validate_re: Clarify docs and error message 2015-09-17 18:48:32 +01:00
David Schmitt
399ce03f68 Merge pull request #524 from binford2k/docs/intersection_truthiness
Clarify what an empty intersection looks like.
2015-09-14 19:36:56 +01:00
Ben Ford
169f8af506 Clarify what an empty intersection looks like. 2015-09-14 11:25:38 -07:00
Bryan Jen
0ea0e40228 Merge pull request #523 from DavidS/modules-2516-is_a
(MODULES-2561) add is_a function
2015-09-14 10:49:50 -07:00
Bryan Jen
c0df8192ee Merge pull request #511 from dmitryilyin/parseyaml_default
[MODULES-2462] Improve parseyaml function
2015-09-14 10:40:35 -07:00
David Schmitt
00c881d0da (MODULES-2516) Adds an is_a() function
The data type system is very hard to understand. Many people don't
understand why

    type_of([1,2,3]) == Array

will fail, but

    type_of([1,2,3]) <= Array

passes. This does a simpler validation that doesn't rely on explicit
data types. Instead, use

    $foo = [1,2,3]
    if $foo.is_a(Array) {
      notify { 'This is an array': }
    }

This is based on code by Ben Ford <ben.ford@puppetlabs.com>.

  * Added acceptance tests
  * Added dispatch
  * Improved unit tests
  * Added docs to README
2015-09-14 18:26:25 +01:00
TP Honey
2a7a93ffb4 Merge pull request #518 from logicminds/case_insensitive
accept any case of boolean strings
2015-09-09 11:20:18 +01:00
TP Honey
00b11c20c8 Merge pull request #519 from dmitryilyin/fetch
[MAINT] Improve 'try_get_value' readme
2015-09-08 11:15:45 +01:00
Dmitry Ilyin
411978db32 [MAINT] Improve 'try_get_value' readme 2015-09-04 19:24:15 +03:00
Corey Osman
f2f2db4795 accept any case of boolean strings
* previously the str2bool function did not accept 'TRUE' as a bool
    type.  This causes the function to now accept TRUE, FALSE strings
    as a boolean type in order to be converted to a proper boolean.
  * This would also cause Y,N, YES, NO to be accepted as boolean types
    as well.
2015-09-04 08:09:26 -07:00
Jonathan Tripathy
05c6587d85 Release Prep 4.9.0 2015-09-03 15:17:32 +01:00
TP Honey
6a1afae97e Merge pull request #517 from DavidS/try_get_value-acceptance
(MAINT) fix up try_get_value acceptance test
2015-09-02 13:42:11 +01:00
David Schmitt
5ef5c6629f (MAINT) fix up try_get_value acceptance test 2015-09-02 13:34:15 +01:00
David Schmitt
64267eb650 Merge pull request #513 from dmitryilyin/fetch
Add a new function "try_get_value"
2015-09-02 09:23:46 +01:00
Dmitry Ilyin
823a352f0f Add a new function "try_get_value"
* Extracts a value from a deeply-nested data structure
* Returns default if a value could not be extracted
2015-09-01 21:45:44 +03:00
David Schmitt
9352db77a6 Merge pull request #515 from jfautley/ticket/MODULES-2478-support_root_home_fact_on_AIX
(MODULES-2478) Make root_home fact work on AIX using native lsuser command
2015-09-01 08:31:31 +01:00
Jon Fautley
6c2a003f21 (MODULES-2478) Support root_home fact on AIX through "lsuser" command
Squashed, and amended test for comment lines.
2015-08-28 15:21:13 +01:00
TP Honey
b10978703a Merge pull request #514 from DavidS/add-convert_base
Adds a convert_base function, which can convert numbers between bases
2015-08-27 10:50:29 +01:00
fhats
2d4f5aa4d9 Adds a convert_base function, which can convert numbers between bases
Squashed, improved docs, updated error handling and unit tests by David S.
2015-08-27 10:42:13 +01:00
Dmitry Ilyin
eb948c4a0d [MODULES-2462] Improve parseyaml function
* Add default value support
  Second argument will be returned if yaml cannot be parsed
  instead of false value
* Update tests
2015-08-25 21:41:03 +03:00
David Schmitt
1bed010dbb Merge pull request #512 from Jetroid/consistentreadme
Consistent Readme
2015-08-25 10:51:39 +01:00
Jetroid
ba345abfb7 Add consistent *Type* information
Remove trailing whitespace

Two functions had not been given any *Type* information. This commit fixes that.
2015-08-25 10:35:57 +01:00
Morgan Haskel
da0e063af6 Merge pull request #510 from DavidS/base64-unit-tests
(MAINT) improve base64 unit tests
2015-08-24 13:47:24 -07:00
David Schmitt
aa23894dd3 (MAINT) improve base64 unit tests 2015-08-24 20:13:33 +01:00
David Schmitt
24e57b5d28 Merge pull request #507 from Jetroid/mod2456
(MODULES-2456) Modify union to accept more than two arrays
2015-08-24 14:36:20 +01:00
Jetroid
1d9189d860 (MODULE-2456) Modify union to accept more than two arrays
Add spec tests to test the new functionality:
 *Case for 3 arrays.
 *Case for 4 arrays.
Modify README to note new functionality.

This is for issue MODULE-2456, follow the precedent of MODULE-444.

This change allows union to be much more useful, unioning many arrays
in one line rather than in n lines. Additionally, as this is only added
functionality, and does not affect the 2 array case that all modules
currently using array are using, it should not affect any existing
modules utilizing union.

This is now useful, for example, for merging many arrays of resources
(eg: packages.) to generate just one list with no duplicates, to avoid
duplicate resource declarations.
2015-08-24 14:24:10 +01:00
Ben Ford
66e118a92a Add a service_provider fact
This returns the default provider Puppet will choose to manage services
on this system by instantiating a dummy service resource type and
returning the provider chosen.

Co-Authored-By: Simon Fraser University <asa188@sfu.ca>
2015-08-19 15:05:47 -07:00
David Schmitt
1d89df906e Merge pull request #505 from gibbsoft/dos2unix
(MODULES-2410) Add new functions dos2unix and unix2dos
2015-08-14 13:51:51 +01:00
Nigel Gibbs
4cbe846750 (MODULES-2410) Add new functions dos2unix and unix2dos 2015-08-14 13:30:01 +01:00
Bryan Jen
e84090df1d Merge pull request #499 from jearls/2370-use-match-for-ensure-absent
[MODULES-2370] allow `match` parameter to influence `ensure => absent` behavior.
2015-08-13 10:14:13 -07:00
Morgan Haskel
605fffd852 Merge pull request #503 from puppetlabs/4.8.x
Mergeback 4.8.x
2015-08-12 14:33:07 -07:00
Hunter Haugen
57275061ab Add puppet_version back to spec_helper 2015-08-11 19:52:43 -07:00
Morgan Haskel
a72918f675 Merge pull request #502 from hunner/fix_after
Sometimes this exits 1
2015-08-11 16:23:52 -07:00
Hunter Haugen
9baca7f755 Sometimes this exits 1 2015-08-11 16:23:06 -07:00
TP Honey
cf5d4ff34b Merge pull request #501 from hunner/bug_helper
Fix extraneous end
2015-08-11 16:43:58 +01:00
Hunter Haugen
0a58b9382c Fix extraneous end 2015-08-11 08:29:48 -07:00
Bryan Jen
a56e119f18 Merge pull request #500 from hunner/prep_4.8.0
Prep 4.8.0
2015-08-10 16:48:57 -07:00
Hunter Haugen
dfa98b89f7 Prep 4.8.0 2015-08-10 16:30:27 -07:00