diff --git a/README.md b/README.md index 326de8d63..206ba4447 100644 --- a/README.md +++ b/README.md @@ -1059,7 +1059,7 @@ For example: #### `dig` -> DEPRECATED: This function has been replaced with a built-in [`dig`](https://docs.puppet.com/puppet/latest/function.html#dig) function as of Puppet 4.5.0. Use [`dig44()`](#dig44) for backwards compatibility or use the new version. +**Deprecated:** This function has been replaced with a built-in [`dig`](https://docs.puppet.com/puppet/latest/function.html#dig) function as of Puppet 4.5.0. Use [`dig44()`](#dig44) for backwards compatibility or use the new version. Retrieves a value within multiple layers of hashes and arrays via an array of keys containing a path. The function goes through the structure by each path component and tries to return the value at the end of the path. @@ -1163,6 +1163,8 @@ Converts the case of a string or of all strings in an array to lowercase. #### `empty` +**Deprecated:** This function has been replaced with a built-in [`empty`](https://docs.puppet.com/puppet/latest/function.html#empty) function as of Puppet 5.5.0. + Returns `true` if the argument is an array or hash that contains no elements, or an empty string. Returns `false` when the argument is a numerical value. *Type*: rvalue. @@ -1274,6 +1276,8 @@ fact('vmware."VRA.version"') #### `flatten` +**Deprecated:** This function has been replaced with a built-in [`flatten`](https://docs.puppet.com/puppet/latest/function.html#flatten) function as of Puppet 5.5.0. + Flattens deeply nested arrays and returns a single flat array as a result. For example, `flatten(['a', ['b', ['c']]])` returns ['a','b','c']. @@ -1514,7 +1518,7 @@ if $baz.is_a(String) { #### `is_absolute_path` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the given path is absolute. @@ -1522,7 +1526,7 @@ Returns `true` if the given path is absolute. #### `is_array` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the variable passed to this function is an array. @@ -1530,7 +1534,7 @@ Returns `true` if the variable passed to this function is an array. #### `is_bool` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the variable passed to this function is a Boolean. @@ -1538,7 +1542,7 @@ Returns `true` if the variable passed to this function is a Boolean. #### `is_domain_name` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the string passed to this function is a syntactically correct domain name. @@ -1553,7 +1557,7 @@ Returns true if the string passed to this function is a valid email address. #### `is_float` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the variable passed to this function is a float. @@ -1561,7 +1565,7 @@ Returns `true` if the variable passed to this function is a float. #### `is_function_available` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Accepts a string as an argument and determines whether the Puppet runtime has access to a function by that name. It returns `true` if the function exists, `false` if not. @@ -1569,7 +1573,7 @@ Accepts a string as an argument and determines whether the Puppet runtime has ac #### `is_hash` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the variable passed to this function is a hash. @@ -1577,7 +1581,7 @@ Returns `true` if the variable passed to this function is a hash. #### `is_integer` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the variable returned to this string is an integer. @@ -1585,7 +1589,7 @@ Returns `true` if the variable returned to this string is an integer. #### `is_ip_address` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the string passed to this function is a valid IP address. @@ -1593,7 +1597,7 @@ Returns `true` if the string passed to this function is a valid IP address. #### `is_ipv6_address` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the string passed to this function is a valid IPv6 address. @@ -1601,7 +1605,7 @@ Returns `true` if the string passed to this function is a valid IPv6 address. #### `is_ipv4_address` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the string passed to this function is a valid IPv4 address. @@ -1615,7 +1619,7 @@ Returns `true` if the string passed to this function is a valid MAC address. #### `is_numeric` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the variable passed to this function is a number. @@ -1623,7 +1627,7 @@ Returns `true` if the variable passed to this function is a number. #### `is_string` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Returns `true` if the variable passed to this function is a string. @@ -1631,6 +1635,8 @@ Returns `true` if the variable passed to this function is a string. #### `join` +**Deprecated:** This function has been replaced with a built-in [`join`](https://docs.puppet.com/puppet/latest/function.html#join) function as of Puppet 5.5.0. + Joins an array into a string using a separator. For example, `join(['a','b','c'], ",")` results in: "a,b,c". *Type*: rvalue. @@ -1647,12 +1653,16 @@ For example, `join_keys_to_values({'a'=>1,'b'=>[2,3]}, " is ")` results in ["a i #### `keys` +**Deprecated:** This function has been replaced with a built-in [`keys`](https://docs.puppet.com/puppet/latest/function.html#keys) function as of Puppet 5.5.0. + Returns the keys of a hash as an array. *Type*: rvalue. #### `length` +**Deprecated:** This function has been replaced with a built-in [`length`](https://docs.puppet.com/puppet/latest/function.html#length) function as of Puppet 5.5.0. + Returns the length of a given string, array or hash. Replaces the deprecated `size()` function. *Type*: rvalue. @@ -2132,7 +2142,7 @@ For example, `{ "key" => "value" }` becomes `"---\nkey: value\n"`. #### `try_get_value` -**DEPRECATED:** replaced by `dig()`. +**Deprecated:** replaced by `dig()`. Retrieves a value within multiple layers of hashes and arrays. @@ -2181,7 +2191,7 @@ $value = try_get_value($data, 'a|b', [], '|') #### `type3x` -**Deprecated**. This function will be removed in a future release. +**Deprecated:** This function will be removed in a future release. Returns a string description of the type of a given value. The type can be a string, array, hash, float, integer, or Boolean. For Puppet 4, use the new type system instead. @@ -2288,7 +2298,7 @@ validate_absolute_path($undefined) #### `validate_array` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates that all passed values are array data structures. Terminates catalog compilation if any value fails this check. @@ -2341,7 +2351,7 @@ validate_augeas($sudoerscontent, 'Sudoers.lns', [], 'Failed to validate sudoers #### `validate_bool` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates that all passed values are either `true` or `false`. Terminates catalog compilation if any value fails this check. @@ -2388,7 +2398,7 @@ validate_cmd($haproxycontent, '/usr/sbin/haproxy -f % -c', 'Haproxy failed to va #### `validate_domain_name` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validate that all values passed are syntactically correct domain names. Aborts catalog compilation if any value fails this check. @@ -2435,7 +2445,7 @@ validate_email_address($some_array) #### `validate_hash` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates that all passed values are hash data structures. Terminates catalog compilation if any value fails this check. @@ -2459,7 +2469,7 @@ validate_hash($undefined) #### `validate_integer` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates an integer or an array of integers. Terminates catalog compilation if any of the checks fail. @@ -2519,7 +2529,7 @@ validate_integer(1, 3, true) #### `validate_ip_address` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates that the argument is an IP address, regardless of whether it is an IPv4 or an IPv6 address. It also validates IP address with netmask. @@ -2635,7 +2645,7 @@ Always note such changes in your CHANGELOG and README. #### `validate_numeric` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates a numeric value, or an array or string of numeric values. Terminates catalog compilation if any of the checks fail. @@ -2653,7 +2663,7 @@ For passing and failing usage, see [`validate_integer`](#validate-integer). The #### `validate_re` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Performs simple validation of a string against one or more regular expressions. @@ -2694,7 +2704,7 @@ To force stringification, use quotes: #### `validate_slength` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates that a string (or an array of strings) is less than or equal to a specified length @@ -2724,7 +2734,7 @@ validate_slength(["discombobulate","moo"],17,10) #### `validate_string` -**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).** +**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy). Validates that all passed values are string data structures. Aborts catalog compilation if any value fails this check. @@ -2774,6 +2784,8 @@ validate_x509_rsa_key_pair($cert, $key) #### `values` +**Deprecated:** This function has been replaced with a built-in [`values`](https://docs.puppet.com/puppet/latest/function.html#values) function as of Puppet 5.5.0. + Returns the values of a given hash. For example, given `$hash = {'a'=1, 'b'=2, 'c'=3} values($hash)` returns [1,2,3]. diff --git a/spec/acceptance/empty_spec.rb b/spec/acceptance/empty_spec.rb index 20d93d5d4..c5c63c043 100644 --- a/spec/acceptance/empty_spec.rb +++ b/spec/acceptance/empty_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper_acceptance' -describe 'empty function' do +describe 'empty function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do describe 'success' do pp1 = <<-DOC $a = '' diff --git a/spec/acceptance/flatten_spec.rb b/spec/acceptance/flatten_spec.rb index cd93d5fdc..79d4854d8 100644 --- a/spec/acceptance/flatten_spec.rb +++ b/spec/acceptance/flatten_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper_acceptance' -describe 'flatten function' do +describe 'flatten function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do describe 'success' do pp1 = <<-DOC $a = ["a","b",["c",["d","e"],"f","g"]] diff --git a/spec/acceptance/join_spec.rb b/spec/acceptance/join_spec.rb index 8e9ed80d2..233b953a0 100644 --- a/spec/acceptance/join_spec.rb +++ b/spec/acceptance/join_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper_acceptance' -describe 'join function' do +describe 'join function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do describe 'success' do pp = <<-DOC $a = ['aaa','bbb','ccc'] diff --git a/spec/acceptance/keys_spec.rb b/spec/acceptance/keys_spec.rb index b3f4c47d8..9c4122c64 100644 --- a/spec/acceptance/keys_spec.rb +++ b/spec/acceptance/keys_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper_acceptance' -describe 'keys function' do +describe 'keys function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do describe 'success' do pp = <<-DOC $a = {'aaa'=>'bbb','ccc'=>'ddd'} diff --git a/spec/acceptance/values_spec.rb b/spec/acceptance/values_spec.rb index 4e5532e5c..b450dc7ba 100644 --- a/spec/acceptance/values_spec.rb +++ b/spec/acceptance/values_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper_acceptance' -describe 'values function' do +describe 'values function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do describe 'success' do pp1 = <<-DOC $arg = { diff --git a/spec/functions/empty_spec.rb b/spec/functions/empty_spec.rb index dbe038b34..c6bf1e44a 100644 --- a/spec/functions/empty_spec.rb +++ b/spec/functions/empty_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'empty' do +describe 'empty', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) } it { diff --git a/spec/functions/flatten_spec.rb b/spec/functions/flatten_spec.rb index ed30e015a..df9ce34c5 100644 --- a/spec/functions/flatten_spec.rb +++ b/spec/functions/flatten_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'flatten' do +describe 'flatten', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) } it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError) } diff --git a/spec/functions/join_spec.rb b/spec/functions/join_spec.rb index a40a7f61c..c24ee7614 100644 --- a/spec/functions/join_spec.rb +++ b/spec/functions/join_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'join' do +describe 'join', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } it { diff --git a/spec/functions/keys_spec.rb b/spec/functions/keys_spec.rb index db864fb6d..23a870e2d 100644 --- a/spec/functions/keys_spec.rb +++ b/spec/functions/keys_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'keys' do +describe 'keys', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } it { diff --git a/spec/functions/length_spec.rb b/spec/functions/length_spec.rb index 71845b16a..550c557ee 100644 --- a/spec/functions/length_spec.rb +++ b/spec/functions/length_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'length' do +describe 'length', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{'length' expects 1 argument, got none}) } it { is_expected.to run.with_params([], 'extra').and_raise_error(ArgumentError, %r{'length' expects 1 argument, got 2}) } diff --git a/spec/functions/values_spec.rb b/spec/functions/values_spec.rb index b02b0af95..85554c6ac 100644 --- a/spec/functions/values_spec.rb +++ b/spec/functions/values_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'values' do +describe 'values', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } it {