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

Change when writing back node run list information in Chef 12 local mode #2596

Closed
carsomyr opened this issue Dec 10, 2014 · 7 comments
Closed
Assignees
Milestone

Comments

@carsomyr
Copy link

With Chef 11, my node JSON looked like this

{
  "name": "workstation",
  "run_list": [
    "blah::default"
  ]
}

and it would be written out as such (after whitelisting) at the end of a Chef 11 run. With Chef 12, the run list information is missing, and it has to do with 3f415b1, in particular these lines. The change is returning a Chef::Node object instead of a JSON Hash, and that is causing this logic to not include run_list as one of the properties to be written back. I don't think this is intentional for local mode operation, since that means the node/my_node.json file will always be dirtied at the end of each run if it declares a run_list.

@lamont-granquist
Copy link
Contributor

I'm not following how you think those lines are the responsible ones? It doesn't look like any behavior has changed there unless there's just some subtle typo I'm missing or something.

@carsomyr
Copy link
Author

@lamont-granquist Quick response version: Notice the :create_additions => false option. It ensured that node information sent back by the Chef 11 client (complete with the run_list synthetic attribute) was manipulated as a Hash. In Chef 12, the option isn't present, and said JSON is parsed into a Chef::Node object. A stack trace touching the entire call chain under discussion is forthcoming.

@lamont-granquist
Copy link
Contributor

@jkeiser already found it and has a patch coming I think. Should have used Chef::JSONCompat#parse which is equivalent to :create_additions => false

@carsomyr
Copy link
Author

@lamont-granquist Thanks! So run lists are supposed to be written back?

@lamont-granquist lamont-granquist added this to the 12.0.2 milestone Dec 10, 2014
@lamont-granquist
Copy link
Contributor

Yeah, should be fixed soon.

@sawanoboly
Copy link
Contributor

Hi,

I wrote spec for this break. https://github.com/opscode/chef/pull/2482/files
Please use it if you like.

@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants