Duplicated fact can be defined in 2 style

Bug #1629228 reported by Masahito Muroi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Triaged
Low
Unassigned

Bug Description

Same facts can be defined in fact style and rule style. When you define one fact with both style, multiple same facts are defined in one policy. It doesn't affect policy calculating result.

$ openstack congress policy create test
+--------------+--------------------------------------+
| Field | Value |
+--------------+--------------------------------------+
| abbreviation | test |
| description | |
| id | adc0a3d0-0513-4112-aa0b-21b8eb731a4c |
| kind | nonrecursive |
| name | test |
| owner_id | user |
+--------------+--------------------------------------+
$ openstack congress policy rule create test 'p(5)'
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| comment | |
| id | 4f8bc6f3-b2cf-48e0-9ae2-4a6708f114e9 |
| name | None |
| rule | p(5) |
+---------+--------------------------------------+
$ openstack congress policy rule create test 'p(5):-true'
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| comment | |
| id | 601bab0a-624b-417f-838c-58cbe2ec3321 |
| name | None |
| rule | p(5) :- |
| | true() |
+---------+--------------------------------------+
$ openstack congress policy rule create test 'q(x):-p(x)'
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| comment | |
| id | f281fc13-0615-4d8a-9595-a411cc9957f5 |
| name | None |
| rule | q(x) :- |
| | p(x) |
+---------+--------------------------------------+
$ openstack congress policy row list test q
+------+
| Col0 |
+------+
| 5 |
+------+
$ openstack congress policy rule list test
// ID: 4f8bc6f3-b2cf-48e0-9ae2-4a6708f114e9
// Name: None
p(5)

// ID: 601bab0a-624b-417f-838c-58cbe2ec3321
// Name: None
p(5):-true

// ID: f281fc13-0615-4d8a-9595-a411cc9957f5
// Name: None
q(x):-p(x)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.