From ff1e58332f15b9df288eacb8dde5a308538838ef Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Wed, 18 Oct 2017 15:51:19 +0100 Subject: [PATCH] Add an empty __init__ method to the base Action class Without this, the action loading will fail in Python 2 if the action subclass doesn't define a __init__. Closes-Bug: #1724594 Change-Id: I7cf9fdc9446462c7f5010d0ba8b307b05656704e --- mistral_lib/actions/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mistral_lib/actions/base.py b/mistral_lib/actions/base.py index 1e0f579..31a7b88 100644 --- a/mistral_lib/actions/base.py +++ b/mistral_lib/actions/base.py @@ -33,6 +33,12 @@ class Action(object): specification (e.g. using DSL or others). """ + def __init__(self): + # NOTE(d0ugal): We need to define an empty __init__ otherwise + # inspect.getargspec will fail in Python 2 for actions that subclass + # but don't define their own __init__. + pass + @abc.abstractmethod def run(self, context): """Run action logic.