Skip to content

Conversation

vuntz
Copy link
Member

@vuntz vuntz commented Apr 26, 2018

While this should never happen, it did happen for a user who was
manipulating chef data. And when this happens, this basically blocks all
of Crowbar.

It's trivial enough to self-heal to justify that it's worth it.

While this should never happen, it did happen for a user who was
manipulating chef data. And when this happens, this basically blocks all
of Crowbar.

It's trivial enough to self-heal to justify that it's worth it.

role
end

def ensure_node_role(node, role_name = nil)
role_name = make_role_name(node.name) if role_name.nil?
unless node.run_list.run_list_items.include?("role[#{role_name}]")

Choose a reason for hiding this comment

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

Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression. (https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals)

@toabctl toabctl added this to the Cloud 8 Update1 milestone Apr 26, 2018
@vuntz vuntz force-pushed the fix-missing-role branch from a805abb to 995d614 Compare April 26, 2018 16:09
@rsalevsky
Copy link
Member

Was there a bugreport? This sound familiar. Also travis is failing.

@vuntz
Copy link
Member Author

vuntz commented Apr 27, 2018

Was there a bugreport?

Nothing in bugzilla, something I got from a customer during a discussion.

@vuntz vuntz added the wip label Apr 27, 2018
Instead of looking at the run list items directly, use the proper
methods from Chef::RunList.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants