Skip to content

Commit f48747b

Browse files
committed
Merge pull request #603 from puppetlabs/4.12.x
Mergeback 4.12.x
2 parents 9e1f74f + 2a75ed0 commit f48747b

File tree

6 files changed

+36
-16
lines changed

6 files changed

+36
-16
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
## Supported Release 4.12.0
2+
###Summary
3+
4+
This release provides several new functions, bugfixes, modulesync changes, and some documentation updates.
5+
6+
####Features
7+
- Adds `clamp`. This function keeps values within a specified range.
8+
- Adds `validate_x509_rsa_key_pair`. This function validates an x509 RSA certificate and key pair.
9+
- Adds `dig`. This function performs a deep lookup in nested hashes or arrays.
10+
- Extends the `base64` support to fit `rfc2045` and `rfc4648`.
11+
- Adds `is_ipv6_address` and `is_ipv4_address`. These functions validate the specified ipv4 or ipv6 addresses.
12+
- Adds `enclose_ipv6`. This function encloses IPv6 addresses in square brackets.
13+
- Adds `ensure_resources`. This function takes a list of resources and creates them if they do not exist.
14+
- Extends `suffix` to support applying a suffix to keys in a hash.
15+
- Apply modulesync changes.
16+
- Add validate_email_address function.
17+
18+
####Bugfixes
19+
- Fixes `fqdn_rand_string` tests, since Puppet 4.4.0 and later have a higher `fqdn_rand` ceiling.
20+
- (MODULES-3152) Adds a check to `package_provider` to prevent failures if Gem is not installed.
21+
- Fixes to README.md.
22+
- Fixes catch StandardError rather than the gratuitous Exception
23+
- Fixes file_line attribute validation.
24+
- Fixes concat with Hash arguments.
25+
126
## Supported Release 4.11.0
227
###Summary
328

README.markdown

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,9 @@ Converts any object to an array containing that object. Empty argument lists are
146146

147147
#### `base64`
148148

149-
Converts a string to and from base64 encoding.
150-
Requires an `action` ('encode', 'decode') and either a plain or base64-encoded `string`,
151-
and an optional `method` ('default', 'strict', 'urlsafe')
149+
Converts a string to and from base64 encoding. Requires an `action` ('encode', 'decode') and either a plain or base64-encoded `string`, and an optional `method` ('default', 'strict', 'urlsafe')
152150

153-
for backward compatibility, `metohd` will be set as `default` if not specified.
151+
For backward compatibility, `method` will be set as `default` if not specified.
154152

155153
*Examples:*
156154
~~~
@@ -265,7 +263,7 @@ Takes a resource reference and an optional hash of attributes. Returns 'true' if
265263

266264
#### `delete`
267265

268-
Deletes all instances of a given element from an array, substring from a string, or key from a hash. Arrays and hashes may also match on regular expressions. For example, `delete(['a','b','c','b'], 'b')` returns ['a','c']; `delete('abracadabra', 'bra')` returns 'acada'. `delete({'a' => 1,'b' => 2,'c' => 3},['b','c'])` returns {'a'=> 1}, `delete(['abf', 'ab', 'ac'], '^ab.*')` returns ['ac']. *Type*: rvalue.
266+
Deletes all instances of a given element from an array, substring from a string, or key from a hash. For example, `delete(['a','b','c','b'], 'b')` returns ['a','c']; `delete('abracadabra', 'bra')` returns 'acada'. `delete({'a' => 1,'b' => 2,'c' => 3},['b','c'])` returns {'a'=> 1}. *Type*: rvalue.
269267

270268
#### `delete_at`
271269

@@ -346,8 +344,7 @@ Returns true if the argument is an array or hash that contains no elements, or a
346344

347345
#### `enclose_ipv6`
348346

349-
Takes an array of ip addresses and encloses the ipv6 addresses with square
350-
brackets. *Type*: rvalue.
347+
Takes an array of ip addresses and encloses the ipv6 addresses with square brackets. *Type*: rvalue.
351348

352349
#### `ensure_packages`
353350

lib/puppet/parser/functions/delete.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# delete.rb
33
#
44

5+
# TODO(Krzysztof Wilczynski): We need to add support for regular expression ...
6+
57
module Puppet::Parser::Functions
68
newfunction(:delete, :type => :rvalue, :doc => <<-EOS
79
Deletes all instances of a given element from an array, substring from a
@@ -32,7 +34,7 @@ module Puppet::Parser::Functions
3234
Array(arguments[1]).each do |item|
3335
case collection
3436
when Array, Hash
35-
collection.delete_if { |coll_item| coll_item =~ %r{#{item}} }
37+
collection.delete item
3638
when String
3739
collection.gsub! item, ''
3840
else

lib/puppet/parser/functions/is_email_address.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
module Puppet::Parser::Functions
6-
newfunction(:is_email_address, type: :rvalue, doc: <<-EOS
6+
newfunction(:is_email_address, :type => :rvalue, :doc => <<-EOS
77
Returns true if the string passed to this function is a valid email address.
88
EOS
99
) do |arguments|

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-stdlib",
3-
"version": "4.11.0",
3+
"version": "4.12.0",
44
"author": "puppetlabs",
55
"summary": "Standard library of resources for Puppet modules.",
66
"license": "Apache-2.0",

spec/functions/delete_spec.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
it { is_expected.to run.with_params([], 'two').and_return([]) }
1313
it { is_expected.to run.with_params(['two'], 'two').and_return([]) }
1414
it { is_expected.to run.with_params(['two', 'two'], 'two').and_return([]) }
15-
it { is_expected.to run.with_params(['one', 'two', 'three'], '^t.*').and_return(['one']) }
1615
it { is_expected.to run.with_params(['one', 'two', 'three'], 'four').and_return(['one', 'two', 'three']) }
16+
it { is_expected.to run.with_params(['one', 'two', 'three'], 'e').and_return(['one', 'two', 'three']) }
1717
it { is_expected.to run.with_params(['one', 'two', 'three'], 'two').and_return(['one', 'three']) }
1818
it { is_expected.to run.with_params(['two', 'one', 'two', 'three', 'two'], 'two').and_return(['one', 'three']) }
1919
it { is_expected.to run.with_params(['one', 'two', 'three', 'two'], ['one', 'two']).and_return(['three']) }
@@ -33,7 +33,7 @@
3333
it { is_expected.to run.with_params('barfoobar', ['foo', 'barbar']).and_return('') }
3434
end
3535

36-
describe 'deleting from a hash' do
36+
describe 'deleting from an array' do
3737
it { is_expected.to run.with_params({}, '').and_return({}) }
3838
it { is_expected.to run.with_params({}, 'key').and_return({}) }
3939
it { is_expected.to run.with_params({'key' => 'value'}, 'key').and_return({}) }
@@ -45,10 +45,6 @@
4545
.with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['key1', 'key2']) \
4646
.and_return( {'key3' => 'value3'})
4747
}
48-
it { is_expected.to run \
49-
.with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['^key\d']) \
50-
.and_return({})
51-
}
5248
end
5349

5450
it "should leave the original array intact" do

0 commit comments

Comments
 (0)