Project

General

Profile

Actions

Bug #17324

closed

Group properties inheritance error when it should not

Added by François ARMAND about 4 years ago. Updated almost 4 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Config management
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:

Description

I have the following case of group and properties

p1: dns=1.1.1.1    p2: dns=9.9.9.9
|   \            /   |
|    p3: p1 then p2  |
|                   /
p4                 /  
 \______    _____ /
        \  /
        node dns= ????

Here, p3 defines an order between p1 and p2: since p2 is in the second criterium, its values override the ones in p1, so dns=9.9.9.9 on node.
But current implementation believes that dns belongs to two diferents hierarchy. If p3 is under p4 and p2, everything is fine.

Actually, the priorization in p3 is the same as adding an edge from p2 to p2, and we must look for the (a) topological sorting of the graphe, after checking that it is acyclic.
So, the real algo should look like:
- for all groups containing the node, build graph with all relation: subset + priorization from groups with multiple criterium,
- partition on connected graphes,
- for each of them, check that there's no cycle,
- topoligacly sort them (this is also the complete inheritance list)
- for each list of sorted vertice, add at head position the global properties, in last position the node properties, compute override
- check if two properties appear in two lists with different values => error

Actions

Also available in: Atom PDF