Skip to content

Commit 6f846d2

Browse files
author
Helen
authored
Merge pull request #896 from pmcmaw/puppet_550_corrections
(MODULES-6894) - Puppet 5.5.0 function deprecation
2 parents d303fff + 67c1c2b commit 6f846d2

File tree

12 files changed

+49
-37
lines changed

12 files changed

+49
-37
lines changed

README.md

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ For example:
10591059

10601060
#### `dig`
10611061

1062-
> 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.
1062+
**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.
10631063

10641064
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.
10651065

@@ -1163,6 +1163,8 @@ Converts the case of a string or of all strings in an array to lowercase.
11631163

11641164
#### `empty`
11651165

1166+
**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.
1167+
11661168
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.
11671169

11681170
*Type*: rvalue.
@@ -1274,6 +1276,8 @@ fact('vmware."VRA.version"')
12741276

12751277
#### `flatten`
12761278

1279+
**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.
1280+
12771281
Flattens deeply nested arrays and returns a single flat array as a result.
12781282

12791283
For example, `flatten(['a', ['b', ['c']]])` returns ['a','b','c'].
@@ -1514,31 +1518,31 @@ if $baz.is_a(String) {
15141518

15151519
#### `is_absolute_path`
15161520

1517-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1521+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15181522

15191523
Returns `true` if the given path is absolute.
15201524

15211525
*Type*: rvalue.
15221526

15231527
#### `is_array`
15241528

1525-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1529+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15261530

15271531
Returns `true` if the variable passed to this function is an array.
15281532

15291533
*Type*: rvalue.
15301534

15311535
#### `is_bool`
15321536

1533-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1537+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15341538

15351539
Returns `true` if the variable passed to this function is a Boolean.
15361540

15371541
*Type*: rvalue.
15381542

15391543
#### `is_domain_name`
15401544

1541-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1545+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15421546

15431547
Returns `true` if the string passed to this function is a syntactically correct domain name.
15441548

@@ -1553,55 +1557,55 @@ Returns true if the string passed to this function is a valid email address.
15531557

15541558
#### `is_float`
15551559

1556-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1560+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15571561

15581562
Returns `true` if the variable passed to this function is a float.
15591563

15601564
*Type*: rvalue.
15611565

15621566
#### `is_function_available`
15631567

1564-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1568+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15651569

15661570
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.
15671571

15681572
*Type*: rvalue.
15691573

15701574
#### `is_hash`
15711575

1572-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1576+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15731577

15741578
Returns `true` if the variable passed to this function is a hash.
15751579

15761580
*Type*: rvalue.
15771581

15781582
#### `is_integer`
15791583

1580-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1584+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15811585

15821586
Returns `true` if the variable returned to this string is an integer.
15831587

15841588
*Type*: rvalue.
15851589

15861590
#### `is_ip_address`
15871591

1588-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1592+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15891593

15901594
Returns `true` if the string passed to this function is a valid IP address.
15911595

15921596
*Type*: rvalue.
15931597

15941598
#### `is_ipv6_address`
15951599

1596-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1600+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
15971601

15981602
Returns `true` if the string passed to this function is a valid IPv6 address.
15991603

16001604
*Type*: rvalue.
16011605

16021606
#### `is_ipv4_address`
16031607

1604-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1608+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
16051609

16061610
Returns `true` if the string passed to this function is a valid IPv4 address.
16071611

@@ -1615,22 +1619,24 @@ Returns `true` if the string passed to this function is a valid MAC address.
16151619

16161620
#### `is_numeric`
16171621

1618-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1622+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
16191623

16201624
Returns `true` if the variable passed to this function is a number.
16211625

16221626
*Type*: rvalue.
16231627

16241628
#### `is_string`
16251629

1626-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
1630+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
16271631

16281632
Returns `true` if the variable passed to this function is a string.
16291633

16301634
*Type*: rvalue.
16311635

16321636
#### `join`
16331637

1638+
**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.
1639+
16341640
Joins an array into a string using a separator. For example, `join(['a','b','c'], ",")` results in: "a,b,c".
16351641

16361642
*Type*: rvalue.
@@ -1647,12 +1653,16 @@ For example, `join_keys_to_values({'a'=>1,'b'=>[2,3]}, " is ")` results in ["a i
16471653

16481654
#### `keys`
16491655

1656+
**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.
1657+
16501658
Returns the keys of a hash as an array.
16511659

16521660
*Type*: rvalue.
16531661

16541662
#### `length`
16551663

1664+
**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.
1665+
16561666
Returns the length of a given string, array or hash. Replaces the deprecated `size()` function.
16571667

16581668
*Type*: rvalue.
@@ -2132,7 +2142,7 @@ For example, `{ "key" => "value" }` becomes `"---\nkey: value\n"`.
21322142

21332143
#### `try_get_value`
21342144

2135-
**DEPRECATED:** replaced by `dig()`.
2145+
**Deprecated:** replaced by `dig()`.
21362146

21372147
Retrieves a value within multiple layers of hashes and arrays.
21382148

@@ -2181,7 +2191,7 @@ $value = try_get_value($data, 'a|b', [], '|')
21812191

21822192
#### `type3x`
21832193

2184-
**Deprecated**. This function will be removed in a future release.
2194+
**Deprecated:** This function will be removed in a future release.
21852195

21862196
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.
21872197

@@ -2288,7 +2298,7 @@ validate_absolute_path($undefined)
22882298

22892299
#### `validate_array`
22902300

2291-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2301+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
22922302

22932303
Validates that all passed values are array data structures. Terminates catalog compilation if any value fails this check.
22942304

@@ -2341,7 +2351,7 @@ validate_augeas($sudoerscontent, 'Sudoers.lns', [], 'Failed to validate sudoers
23412351

23422352
#### `validate_bool`
23432353

2344-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2354+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
23452355

23462356
Validates that all passed values are either `true` or `false`.
23472357
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
23882398

23892399
#### `validate_domain_name`
23902400

2391-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2401+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
23922402

23932403
Validate that all values passed are syntactically correct domain names. Aborts catalog compilation if any value fails this check.
23942404

@@ -2435,7 +2445,7 @@ validate_email_address($some_array)
24352445

24362446
#### `validate_hash`
24372447

2438-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2448+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
24392449

24402450
Validates that all passed values are hash data structures. Terminates catalog compilation if any value fails this check.
24412451

@@ -2459,7 +2469,7 @@ validate_hash($undefined)
24592469

24602470
#### `validate_integer`
24612471

2462-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2472+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
24632473

24642474
Validates an integer or an array of integers. Terminates catalog compilation if any of the checks fail.
24652475

@@ -2519,7 +2529,7 @@ validate_integer(1, 3, true)
25192529

25202530
#### `validate_ip_address`
25212531

2522-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2532+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
25232533

25242534
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.
25252535

@@ -2635,7 +2645,7 @@ Always note such changes in your CHANGELOG and README.
26352645

26362646
#### `validate_numeric`
26372647

2638-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2648+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
26392649

26402650
Validates a numeric value, or an array or string of numeric values. Terminates catalog compilation if any of the checks fail.
26412651

@@ -2653,7 +2663,7 @@ For passing and failing usage, see [`validate_integer`](#validate-integer). The
26532663

26542664
#### `validate_re`
26552665

2656-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2666+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
26572667

26582668
Performs simple validation of a string against one or more regular expressions.
26592669

@@ -2694,7 +2704,7 @@ To force stringification, use quotes:
26942704

26952705
#### `validate_slength`
26962706

2697-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2707+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
26982708

26992709
Validates that a string (or an array of strings) is less than or equal to a specified length
27002710

@@ -2724,7 +2734,7 @@ validate_slength(["discombobulate","moo"],17,10)
27242734

27252735
#### `validate_string`
27262736

2727-
**Deprecated. Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).**
2737+
**Deprecated:** Will be removed in a future version of stdlib. See [`validate_legacy`](#validate_legacy).
27282738

27292739
Validates that all passed values are string data structures. Aborts catalog compilation if any value fails this check.
27302740

@@ -2774,6 +2784,8 @@ validate_x509_rsa_key_pair($cert, $key)
27742784

27752785
#### `values`
27762786

2787+
**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.
2788+
27772789
Returns the values of a given hash.
27782790

27792791
For example, given `$hash = {'a'=1, 'b'=2, 'c'=3} values($hash)` returns [1,2,3].

spec/acceptance/empty_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper_acceptance'
22

3-
describe 'empty function' do
3+
describe 'empty function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
describe 'success' do
55
pp1 = <<-DOC
66
$a = ''

spec/acceptance/flatten_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper_acceptance'
22

3-
describe 'flatten function' do
3+
describe 'flatten function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
describe 'success' do
55
pp1 = <<-DOC
66
$a = ["a","b",["c",["d","e"],"f","g"]]

spec/acceptance/join_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper_acceptance'
22

3-
describe 'join function' do
3+
describe 'join function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
describe 'success' do
55
pp = <<-DOC
66
$a = ['aaa','bbb','ccc']

spec/acceptance/keys_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper_acceptance'
22

3-
describe 'keys function' do
3+
describe 'keys function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
describe 'success' do
55
pp = <<-DOC
66
$a = {'aaa'=>'bbb','ccc'=>'ddd'}

spec/acceptance/values_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper_acceptance'
22

3-
describe 'values function' do
3+
describe 'values function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
describe 'success' do
55
pp1 = <<-DOC
66
$arg = {

spec/functions/empty_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper'
22

3-
describe 'empty' do
3+
describe 'empty', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
it { is_expected.not_to eq(nil) }
55
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) }
66
it {

spec/functions/flatten_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper'
22

3-
describe 'flatten' do
3+
describe 'flatten', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
it { is_expected.not_to eq(nil) }
55
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError) }
66
it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError) }

spec/functions/join_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper'
22

3-
describe 'join' do
3+
describe 'join', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
it { is_expected.not_to eq(nil) }
55
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
66
it {

spec/functions/keys_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper'
22

3-
describe 'keys' do
3+
describe 'keys', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
it { is_expected.not_to eq(nil) }
55
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
66
it {

spec/functions/length_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper'
22

3-
describe 'length' do
3+
describe 'length', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
it { is_expected.not_to eq(nil) }
55
it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{'length' expects 1 argument, got none}) }
66
it { is_expected.to run.with_params([], 'extra').and_raise_error(ArgumentError, %r{'length' expects 1 argument, got 2}) }

spec/functions/values_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'spec_helper'
22

3-
describe 'values' do
3+
describe 'values', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
44
it { is_expected.not_to eq(nil) }
55
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
66
it {

0 commit comments

Comments
 (0)