policy enforcement - add cleaning action rules for simulation call

Bug #1439595 reported by Radek Pospisil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
High
Filip Blaha

Bug Description

Currently policy enforcement's policy simulation call just adds mapping. In case of env redeployment it can lead to invalid data, so we need to clean data populated by the the driver at the beginning of simulation sequence.

Further in order to simplify congress setup we need to also create murano_system policy as part of congress client initialization in Murano.

-----
Here are policy and rule definitions for clean up (expressed as congress cli commands):

openstack congress policy create murano_action --kind action

openstack congress policy rule create murano_action 'action("deleteEnv")'

# states
openstack congress policy rule create murano_action 'murano:states-(eid,st) :- deleteEnv(eid), murano:states( eid, st)'

# parent_types
openstack congress policy rule create murano_action 'murano:parent_types-(tid, type) :- deleteEnv(eid), murano:connected(eid, tid),murano:parent_types(tid,type)'
openstack congress policy rule create murano_action 'murano:parent_types-(eid, type) :- deleteEnv(eid), murano:parent_types(eid,type)'

# properties
openstack congress policy rule create murano_action 'murano:properties-(oid, pn, pv) :- deleteEnv(eid), murano:connected( eid, oid), murano:properties(oid, pn, pv)'
openstack congress policy rule create murano_action 'murano:properties-(eid, pn, pv) :- deleteEnv(eid), murano:properties(eid, pn, pv)'

# objects
openstack congress policy rule create murano_action 'murano:objects-(oid, pid, ot) :- deleteEnv(eid), murano:connected(eid, oid), murano:objects(oid, pid, ot)'
openstack congress policy rule create murano_action 'murano:objects-(eid, tnid, ot) :- deleteEnv(eid), murano:objects(eid, tnid, ot)'

# relationships
openstack congress policy rule create murano_action 'murano:relationships-(sid,tid, rt) :- deleteEnv(eid), murano:connected( eid, sid), murano:relationships( sid, tid, rt)'
openstack congress policy rule create murano_action 'murano:relationships-(eid,tid, rt) :- deleteEnv(eid), murano:relationships( eid, tid, rt)'

# connected
openstack congress policy rule create murano_action 'murano:connected-(tid, tid2) :- deleteEnv(eid), murano:connected(eid, tid), murano:connected(tid,tid2)'
openstack congress policy rule create murano_action 'murano:connected-(eid,tid) :- deleteEnv(eid), murano:connected(eid,tid)'

----------
policy simulation example (see
 openstack congress policy simulate murano_system 'predeploy_errors(oid,eid,msg)' 'deleteEnv("<envid>") ... original sequence ...' murano_action

Changed in murano:
assignee: nobody → Filip Blaha (filip-blaha)
Changed in murano:
status: New → Confirmed
milestone: none → kilo-rc1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

Fix proposed to branch: master
Review: https://review.openstack.org/171684

Changed in murano:
status: Confirmed → In Progress
Changed in murano:
importance: Medium → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on murano (master)

Change abandoned by Filip Blaha (<email address hidden>) on branch: master
Review: https://review.openstack.org/171684
Reason: proposed solution is not working correctly in case of insufficient privileges to create rules in congress

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

Fix proposed to branch: master
Review: https://review.openstack.org/172950

Changed in murano:
assignee: Filip Blaha (filip-blaha) → Radek Pospisil (radek-pospisil)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on murano (master)

Change abandoned by Filip Blaha (<email address hidden>) on branch: master
Review: https://review.openstack.org/171684

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

Fix proposed to branch: master
Review: https://review.openstack.org/172990

Changed in murano:
assignee: Radek Pospisil (radek-pospisil) → Filip Blaha (filip-blaha)
Changed in murano:
assignee: Filip Blaha (filip-blaha) → Radek Pospisil (radek-pospisil)
Changed in murano:
assignee: Radek Pospisil (radek-pospisil) → Filip Blaha (filip-blaha)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to murano (master)

Reviewed: https://review.openstack.org/172990
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=eea9b5a63108c359f22a1f8c5c8936a06e50a1b8
Submitter: Jenkins
Branch: master

commit eea9b5a63108c359f22a1f8c5c8936a06e50a1b8
Author: Filip Blaha <email address hidden>
Date: Mon Apr 13 18:17:16 2015 +0200

    Policy enforcement - add cleaning action rules

    Simulation purges data populated by murano driver in congress.
    Test creates rules as its prerequisites.

    Change-Id: Ia002b60ad5ba0d831e73b69f660a38c4f5e35f20
    Closes-Bug: #1439595

Changed in murano:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/172950
Committed: https://git.openstack.org/cgit/stackforge/murano/commit/?id=a94af72f1eb269c3ccddd4433894000fac96b9a5
Submitter: Jenkins
Branch: master

commit a94af72f1eb269c3ccddd4433894000fac96b9a5
Author: Radek Pospisil <email address hidden>
Date: Mon Apr 13 17:03:05 2015 +0200

    Cleanup action policies will be created manually as described in this documentation

    Change-Id: Ia7e01a58cf655b3da13759c72be927c9d7384c66
    Partial-Bug: #1439595

Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: kilo-rc1 → 2015.1.0
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.