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

make metadata.rb legacy mode consistent for supports #367

Merged
merged 1 commit into from
Jan 15, 2016

Conversation

arlimus
Copy link
Contributor

@arlimus arlimus commented Jan 15, 2016

Before introducing InSpec profiles in #252 we had metadata.rb keep all information. This included an undisclosed field called supports. However, this field was never actually used in practice. So for legacy profiles, this means that supports was ignored. In order to keep old profiles running in exactly the way they were before, ignore this field when reading from metadata.rb

Before introducing InSpec profiles in #252 we had `metadata.rb` keep all information. This included an undisclosed field called `supports`. However, this field was never actually used in practice. So for legacy profiles, this means that `supports` was ignored. In order to keep old profiles running in exactly the way they were before, ignore this field when reading from metadata.rb
@@ -35,14 +35,9 @@ def initialize(ref, logger = nil)
end

def supports(sth, version = nil)
params[:supports] ||= []
Copy link
Contributor

Choose a reason for hiding this comment

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

we share the same implementation for inspec.yml and metadata.rb. I would assume, this breaks the new feature as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arlimus
Copy link
Contributor Author

arlimus commented Jan 15, 2016

This causes an error with compliance profiles, that use the old metadata.rb structure and fill in the field supports. It handles all those targets correctly, where supports specifies the OS by name. However, with setting:

supports 'linux'

it will fail on all systems (unless you find one where OS-name is 'linux' ;) ).

This takes care of the issue, by ignoring that field completely, since that syntax is deprecated.

chris-rock added a commit that referenced this pull request Jan 15, 2016
make metadata.rb legacy mode consistent for supports
@chris-rock chris-rock merged commit 0366ba2 into master Jan 15, 2016
@chris-rock chris-rock deleted the dr/backwards-compat branch January 15, 2016 19:41
@chris-rock chris-rock added this to the 0.9.9 milestone Jan 19, 2016
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