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

False positive "Single Quoted String Containing Variables" in single quoted strings. #943

Open
func0der opened this issue May 5, 2021 · 0 comments

Comments

@func0der
Copy link

func0der commented May 5, 2021

A similar issue has been reported a couple of years ago: #113
But it seems that the problem is still there.

Example:

exec{ 'wrong single quoted string containing a variable':
    command   => '/bin/bash "/opt/software/software-bin.${SOME_ENVIRONMENT_VARIABLE}/binary do-something"',
  }

In this particular case the software has a directory for each version and the current version is stored in a an environment variable.
But the use case is totally irrelevant for this issue.

The reported issue is Single Quoted String Containing Variables.
Yet this should not be triggered, because the whole string is enclosed in single quotes. Therefore we INTENTIONALLY are preventing variable substitution.

If we made a mistake and the intended behavior should have been variable substitution DURING a puppet run and not during bash execution, it should be found by tests and not by linting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant