Add action_update interface to db_api
This patch added action_update interface to db_api. Change-Id: I9d57e1f9be4f1394ab5f80edf5e0faa18d748e56
This commit is contained in:
@@ -1046,6 +1046,16 @@ def action_create(context, values):
|
||||
return action
|
||||
|
||||
|
||||
def action_update(context, action_id, values):
|
||||
action = action_get(context, action_id)
|
||||
|
||||
if not action:
|
||||
raise exception.ActionNotFound(action=action_id)
|
||||
|
||||
action.update(values)
|
||||
action.save(_session(context))
|
||||
|
||||
|
||||
def action_get(context, action_id):
|
||||
action = model_query(context, models.Action).get(action_id)
|
||||
if action is None:
|
||||
|
||||
Reference in New Issue
Block a user