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

Conditional use of unified_mode true needs to warn #936

Open
lamont-granquist opened this issue Jan 25, 2022 · 1 comment
Open

Conditional use of unified_mode true needs to warn #936

lamont-granquist opened this issue Jan 25, 2022 · 1 comment
Labels
New Cop Proposal A proposal for a new Cookstyle cop Status: Untriaged An issue that has yet to be triaged.

Comments

@lamont-granquist
Copy link
Contributor

unified_mode true if respond_to?(:unified_mode)

That isn't a coherent thing to ever want to do, since you get unified_mode true behavior on newer chef-client and unified_mode false behavior on older chef-client and will require careful testing on all versions, and crazy questions to me on how to write code so that it works the same both ways.

In general people need to pick one way or the other, and have backwards compatibility via unified_mode false (and suffer the deprecation warning forever reminding you that support for Chef 12 has been dropped ages ago) or else set unified_mode true and properly drop support for old Chef 12

@lamont-granquist lamont-granquist added Status: Untriaged An issue that has yet to be triaged. New Cop Proposal A proposal for a new Cookstyle cop labels Jan 25, 2022
@lamont-granquist
Copy link
Contributor Author

What is okay to do is the other boolean:

unified_mode false if respond_to?(:unified_mode)

That is fine. That turns off unified_mode everywhere and you can write your resources old-style forever and opt-out of unified mode.

Individual sites can ever put this in config.rb (or kitchen.yml settings):

silence_deprecation_warnings %w{unified_mode}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Cop Proposal A proposal for a new Cookstyle cop Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant