How to use the chaostoolkit.actions.execute_action function in chaostoolkit

To help you get started, we’ve selected a few chaostoolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chaostoolkit / chaostoolkit / chaostoolkit / plan.py View on Github external
"""
    action = step.get("action")
    if not action:
        return

    action_name = action.get("name")
    if not action_name:
        raise InvalidPlan("action requires a name")

    if "layer" not in action:
        raise InvalidPlan("action requires the target layer to be set")

    pause(action, "before")
    logger.info(" Executing action '{name}'".format(name=action_name))
    layer = layers.get(action["layer"])
    execute_action(action_name, action, layer)
    pause(action, "after")