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 virtualization usage in older inspec versions #95

Merged
merged 1 commit into from Jun 5, 2018
Merged

fix virtualization usage in older inspec versions #95

merged 1 commit into from Jun 5, 2018

Conversation

mattlqx
Copy link
Contributor

@mattlqx mattlqx commented May 31, 2018

This profile throws an exception when using InSpec < 2.0.30 on non-virtualized systems because this fix (inspec/inspec#2603) was not included in prior versions. This pull simply catches the exception where virtualization.* is called in pure Ruby.

Older versions are still very much alive in bundles of Chef Automate 1.x and ChefDK 2.x and are difficult to upgrade ad-hoc.

This profile throws an exception when using InSpec < 2.0.30 on non-virtualized systems because this fix (inspec/inspec#2603) was not included in prior versions. This pull simply catches the exception where virtualization.* is called in pure Ruby.
@chris-rock
Copy link
Member

@mattlqx Nice catch. What do you think about adding a minimum inspec version into the inspec.yml instead?

@mattlqx
Copy link
Contributor Author

mattlqx commented May 31, 2018

Pinning to a newer version wouldn't help me out where I'm running older versions of Automate and ChefDK because of other compatibility/product issues. I suspect there are others in the same situation.

If you don't want to go with catching the NoMethodError, from what I understand if the virtualization usage is moved to the only_ifs on the controls, it would also fix the problem?

@chris-rock
Copy link
Member

Got ya. That makes sense for now.

Would love to understand the compatibility issues better, since we may need to add some additional capability to InSpec or Automate.

Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mattlqx

@chris-rock chris-rock merged commit 2768ba0 into dev-sec:master Jun 5, 2018
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.

None yet

2 participants