Fix create custom Mistral action

Class mistral.actions.base.Action is moved to
mistral_lib.actions.Action accoring to
https://docs.openstack.org/mistral/latest/developer/extensions/creating_custom_action.html

This change imports the new action class and
add context parameter for the run method.

Related-Bug: #1874007
Change-Id: I7858f69ca051c64a8ac52e6bfde353d55a42a43e
This commit is contained in:
Quang Hiep 2020-04-23 06:07:21 +00:00
parent aba4cf9c89
commit b38ed56020
1 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@
import netaddr
from mistral.actions import base
from mistral_lib import actions
from oslo_config import cfg
from oslo_log import log as logging
@ -25,7 +25,7 @@ from tacker import context as t_context
LOG = logging.getLogger(__name__)
class PingVimAction(base.Action):
class PingVimAction(actions.Action):
def __init__(self, count, targetip, vim_id,
interval, timeout):
@ -80,7 +80,7 @@ class PingVimAction(base.Action):
vim_id=self.vim_id,
status=status)
def run(self):
def run(self, action_ctx):
servers = []
try:
rpc.init_action_rpc(cfg.CONF)