Skip to content

(MODULES-6894) - Puppet 5.5.0 function deprecation #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 38 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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'].
Expand Down Expand Up @@ -1514,31 +1518,31 @@ 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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.

Expand All @@ -1553,55 +1557,55 @@ 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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.

Expand All @@ -1615,22 +1619,24 @@ 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.

*Type*: rvalue.

#### `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.

*Type*: rvalue.

#### `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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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].
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/empty_spec.rb
Original file line number Diff line number Diff line change
@@ -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 = ''
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/flatten_spec.rb
Original file line number Diff line number Diff line change
@@ -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"]]
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/join_spec.rb
Original file line number Diff line number Diff line change
@@ -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']
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/keys_spec.rb
Original file line number Diff line number Diff line change
@@ -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'}
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/values_spec.rb
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/empty_spec.rb
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/flatten_spec.rb
Original file line number Diff line number Diff line change
@@ -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) }
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/join_spec.rb
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/keys_spec.rb
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/length_spec.rb
Original file line number Diff line number Diff line change
@@ -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}) }
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/values_spec.rb
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down