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 pedant compare #1145

Merged
merged 1 commit into from
Mar 14, 2017
Merged

Fix pedant compare #1145

merged 1 commit into from
Mar 14, 2017

Conversation

markan
Copy link
Contributor

@markan markan commented Mar 14, 2017

When comparing elements of a hash, if an element is an array we exit
if it matches, rather than continuing on to check the other keys.

This is because we used 'return true' in the body of an all? loop,
apparently intending to move to the next iteration of the loop, but
instead exiting the whole function with an incorrect 'true'.

@markan markan force-pushed the ma/fix_pedant_compare branch from 55c643e to beff6ab Compare March 14, 2017 03:34
srenatus added a commit to chef/chef-zero that referenced this pull request Mar 14, 2017
Due to a bug in oc-chef-pedant[1], we'd never noticed that this doesn't
return what it should return to match chef-server.

[1]: chef/chef-server#1145

Signed-off-by: Stephan Renatus <[email protected]>
When comparing elements of a hash, if an element is an array we exit
if it matches, rather than continuing on to check the other keys.

This is because we used 'return true' in the body of a all? loop,
apparently intending to move to the next iteration of the loop, but
instead exiting the whole function with an incorrect 'true'.

Due to this bug in our rpsec matcher, we weren't correctly checking the
results of various ACL tests. This corrects the test to match what we
actually return, as the actual permissions seem sane and reasonable.

Signed-off-by: Mark Anderson <[email protected]>
@srenatus srenatus force-pushed the ma/fix_pedant_compare branch from beff6ab to 7765a27 Compare March 14, 2017 10:39
@stevendanna stevendanna merged commit 1fb162e into master Mar 14, 2017
@stevendanna stevendanna deleted the ma/fix_pedant_compare branch March 14, 2017 10:58
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