Skip to content
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

Whoops! It looks like puppet-lint has encountered an error that it doesn't know how to handle. #131

Open
cxm21 opened this issue Jun 12, 2023 · 0 comments
Labels
bug Something isn't working community

Comments

@cxm21
Copy link

cxm21 commented Jun 12, 2023

Describe the Bug

We use functions .reduce .unique .sort .each we get the Whoops! error and "NoMethodError: undefined method `[]' for nil:NilClass". It passed puppet-lint 2.5.2 without errors.

Expected Behavior

puppet-lint should handle the functions .reduce .unique .sort .each in the .pp file.

Steps to Reproduce

Run puppet-lint on *.pp with functions .reduce .unique .sort .each, for example:

.reduce([]) | $memo,$value | {
if ( $value[0] == '/' ) {
if ( $validate_mpt and
( ! $absent_if_nompt ) and
( $::facts[mountpoints][$value] == undef ) ) {
$memo
} else {
$memo + [ $value ]
}
} else {
$memo + keys($::facts[mountpoints]).grep($value)
}
}
.unique
.sort

Environment

  • Version 4.0.0, also the 3.x.x versions
  • Platform CentOS 6.10 and RHEL 8.7

Additional Context

We are converting from Puppet V6 to Puppet V7 when we encounter this problem.
puppet-lint-output.txt

@cxm21 cxm21 added the bug Something isn't working label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community
Projects
None yet
Development

No branches or pull requests

2 participants