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

crowbar: Self-heal if node is missing its node role in the run list #1565

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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
@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