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

Fix deprecation warnings #123

Merged
merged 2 commits into from
Sep 25, 2016

Conversation

adamburns7933
Copy link
Contributor

node.set causes deprecation warnings in tests (found while writing a cookbook to setup a bastion SSH server).

I changed the specs to node.normal because that’s what the ChefSpec readme now recommends (a change made by the maintainer after getting reports of the same deprecation warnings) and because node.default broke tests.

The recipes I changed to node.default, which is a little different underneath because default attributes don’t persist and ones set by node.set/node.normal do. I did this for several reasons:

  • The Chef attributes doc recommends using node.default as often as possible.
  • The Chef Style Guide recommends avoiding node.set/node.normal.
  • The loop where they’re used executes on every Chef client run so it feels better to start with defaults and clean up only if needed, rather than preserving values from previous runs.

All ChefSpecs and kitchens pass.

There is already coverage of the legacy attr support for both recipes tests what gets rendered into the configs. I could add tests that the new attrs are updated when the old attrs are used, but that doesn't feel very valuable. I can add them if you think that’s better, though, no problem.

Let me know if you see any problems or you’d like anything done differently and I’ll rebase it in. Thanks!

Platform used to run ChefSpec:

> chef --version

Chef Development Kit Version: 0.17.17

chef-client version: 12.13.37

delivery version: master (f68e5c5804cd7d8a76c69b926fbb261e1070751b)

berks version: 4.3.5

kitchen version: 1.11.1

> chef exec rspec --version

3.5.2

Adam added 2 commits September 24, 2016 10:17
node.set will be deprecated and using it generates warnings.
node.set will be deprecated and using it generates warnings.
Although node.normal would have mirrored the original node.set,
the default level is sufficient and Chef recommends avoiding
node.normal.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 3d7ff56 on operatingops:fix_deprecation_warnings into afff57b on dev-sec:master.

@chris-rock
Copy link
Member

Awesome @operatingops Thanks for the update!

@chris-rock chris-rock merged commit 6b22038 into dev-sec:master Sep 25, 2016
@chris-rock
Copy link
Member

I released a new version 1.2.1

@adamburns7933
Copy link
Contributor Author

No problem @chris-rock - thanks for the release!

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

Successfully merging this pull request may close these issues.

3 participants