Add data field to action DB model for policy_check
This patch added a data field to action DB model. This field is used to store result data that generated during policy_check and action execution. Based on this, policy_data parameter is not needed anymore when invoking attach/detach/pre_op/post_op methods of policy and all action methods. This patch also recorded the id of nodes which was deleted or created during action progress. This id list will be persisted into DB as action data and then consumed by policies whose check target is 'AFTER'. Change-Id: I88cb033974b57acda1678039a8362bdbee5bf7a4
This commit is contained in:
@@ -207,6 +207,7 @@ def upgrade(migrate_engine):
|
||||
sqlalchemy.Column('created_time', sqlalchemy.DateTime),
|
||||
sqlalchemy.Column('updated_time', sqlalchemy.DateTime),
|
||||
sqlalchemy.Column('deleted_time', sqlalchemy.DateTime),
|
||||
sqlalchemy.Column('data', types.Dict),
|
||||
mysql_engine='InnoDB',
|
||||
mysql_charset='utf8'
|
||||
)
|
||||
|
||||
@@ -296,6 +296,7 @@ class Action(BASE, SenlinBase, SoftDelete):
|
||||
created_time = sqlalchemy.Column(sqlalchemy.DateTime)
|
||||
updated_time = sqlalchemy.Column(sqlalchemy.DateTime)
|
||||
deleted_time = sqlalchemy.Column(sqlalchemy.DateTime)
|
||||
data = sqlalchemy.Column(types.Dict)
|
||||
|
||||
|
||||
class Event(BASE, SenlinBase, SoftDelete):
|
||||
|
||||
Reference in New Issue
Block a user