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

Fixes #9802: Error when displaying Rules when a rule is applying a directive that does not exists anymore #1404

Conversation

VinceMacBuche
Copy link
Member

@@ -542,7 +542,7 @@ class RuleGrid(
val t0 = System.currentTimeMillis

val nodes = groupsLib.getNodeIds(line.rule.targets, nodesInfo)
val (policyMode,explanation) = ComputePolicyMode.ruleMode(globalMode, line.rule.directiveIds.map(directiveLib.allDirectives(_)).map(_._2))
val (policyMode,explanation) = ComputePolicyMode.ruleMode(globalMode, line.rule.directiveIds.map(directiveLib.allDirectives.get(_)).flatMap(_.map(_._2)))
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment sating what is the will here?
Something like:
"We don't fail on missing directive. Most likelly a deleted directive link wasn't updated correctly. We should assure consistency on all rudder config elem, but until that (big) change, it seems to be the most resilient solution".

@VinceMacBuche
Copy link
Member Author

Commit modified

@VinceMacBuche VinceMacBuche force-pushed the bug_9802/error_when_displaying_rules_when_a_rule_is_applying_a_directive_that_does_not_exists_anymore branch from f272b86 to 99e0506 Compare December 13, 2016 10:54
@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 99e0506 into Normation:branches/rudder/4.0 Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants