Skip to content

Commit f270927

Browse files
author
jordanbreen28
committed
(maint) - final rubocop fixes
1 parent c573315 commit f270927

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

lib/puppet/parser/functions/node_encrypt.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
Puppet::Parser::Functions.newfunction(:node_encrypt,
66
type: :rvalue,
7-
arity: 1,
8-
doc: <<~DOC
7+
arity: 1, doc: <<-DOC
98
This function simply encrypts the String or Sensitive passed to it using the certificate
109
belonging to the client the catalog is being compiled for.
1110
DOC
12-
) do |args|
11+
) do |args|
1312
content = args.first
1413
content = content.unwrap if defined?(Puppet::Pops::Types::PSensitiveType::Sensitive) && content.is_a?(Puppet::Pops::Types::PSensitiveType::Sensitive)
1514

lib/puppet/parser/functions/redact.rb

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
# frozen_string_literal: true
22

33
Puppet::Parser::Functions.newfunction(:redact, doc: <<~DOC
4-
This function will modify the catalog during compilation to remove the named
5-
parameter from the class from which it was called. For example, if you wrote a
6-
class named `foo` and called `redact('bar')` from within that class, then the
7-
catalog would not record the value of `bar` that `foo` was called with.
8-
9-
~~~ puppet
10-
class foo($bar) {
11-
# this call will display the proper output, but because it's not a resource
12-
# the string won't exist in the catalog.
13-
notice("Class['foo'] was called with param ${bar}")
14-
15-
# but the catalog won't record what the passed in param was.
16-
redact('bar')
17-
}
18-
19-
class { 'foo':
20-
bar => 'this will not appear in the catalog',
21-
}
22-
~~~
23-
24-
**Warning**: If you use that parameter to declare other classes or resources,
25-
then you must take further action to remove the parameter from those declarations!
26-
27-
This takes an optional second parameter of the value to replace the original
28-
parameter declaration with. This parameter is required if the class declares
29-
a type that is not `String` for the parameter you're redacting.
30-
DOC
31-
) do |args|
4+
This function will modify the catalog during compilation to remove the named
5+
parameter from the class from which it was called. For example, if you wrote a
6+
class named `foo` and called `redact('bar')` from within that class, then the
7+
catalog would not record the value of `bar` that `foo` was called with.
8+
9+
~~~ puppet
10+
class foo($bar) {
11+
# this call will display the proper output, but because it's not a resource
12+
# the string won't exist in the catalog.
13+
notice("Class['foo'] was called with param ${bar}")
14+
15+
# but the catalog won't record what the passed in param was.
16+
redact('bar')
17+
}
18+
19+
class { 'foo':
20+
bar => 'this will not appear in the catalog',
21+
}
22+
~~~
23+
24+
**Warning**: If you use that parameter to declare other classes or resources,
25+
then you must take further action to remove the parameter from those declarations!
26+
27+
This takes an optional second parameter of the value to replace the original
28+
parameter declaration with. This parameter is required if the class declares
29+
a type that is not `String` for the parameter you're redacting.
30+
DOC
31+
) do |args|
3232
raise Puppet::ParseError, 'The redact function requires 1 or 2 arguments' unless [1, 2].include? args.size
3333

3434
param = args[0]

0 commit comments

Comments
 (0)