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

Fauxhai lacks the empty virtualization hash #206

Closed
tas50 opened this issue Mar 22, 2016 · 5 comments
Closed

Fauxhai lacks the empty virtualization hash #206

tas50 opened this issue Mar 22, 2016 · 5 comments

Comments

@tas50
Copy link
Contributor

tas50 commented Mar 22, 2016

A non-virtualized Chef system still includes the empty hash. A lot of the time people do checks like:

unless node['virtualization']['systems']['docker'] && node['virtualization']['systems']['docker'] == 'guest'

This will fail on fauxhai with a nil error. node['virtualization']['systems'] should exist which would prevent those failures.

@sethvargo
Copy link
Contributor

Hrm - was that always true or is that a recent addition to Ohai?

@tas50
Copy link
Contributor Author

tas50 commented Mar 22, 2016

7.20 so chef 11.14

@sethvargo
Copy link
Contributor

Ah okay. Fauxhai exists pre-that. We could probably do a quick thing like:

Dir.glob("**/*.json).each do |file|
  x = JSON.parse(File.read(file))
  x["virtualization"] = {}
  File.open(file, "w") { |f| f.write(JSON.generate(x) }
end

@mfischer-zd
Copy link
Contributor

Yes please. It's currently causing chefspec tests to fail, if the latest build-essential cookbook is used.

@tas50 tas50 closed this as completed Mar 27, 2016
@tas50
Copy link
Contributor Author

tas50 commented Mar 27, 2016

Merged to master

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2018
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

3 participants