From 73984f8a6ff7368591e7d0e87d827283b01859d0 Mon Sep 17 00:00:00 2001 From: Jinping Han Date: Tue, 12 Mar 2019 14:03:45 -0700 Subject: [PATCH] Fixes https://github.com/StackStorm/st2/issues/4567 : config_context renders against incorrect pack Add new action to `tests` pack for render config context integration test. This is second part of code changes. Please see https://github.com/StackStorm/st2/pull/4570 --- packs/tests/actions/render_config_context.py | 7 +++++++ packs/tests/actions/render_config_context.yaml | 12 ++++++++++++ packs/tests/config.schema.yaml | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 packs/tests/actions/render_config_context.py create mode 100644 packs/tests/actions/render_config_context.yaml create mode 100644 packs/tests/config.schema.yaml diff --git a/packs/tests/actions/render_config_context.py b/packs/tests/actions/render_config_context.py new file mode 100644 index 0000000..97ab48f --- /dev/null +++ b/packs/tests/actions/render_config_context.py @@ -0,0 +1,7 @@ +from st2common.runners.base_action import Action + + +class PrintPythonVersionAction(Action): + + def run(self, value1): + return {"context_value": value1} diff --git a/packs/tests/actions/render_config_context.yaml b/packs/tests/actions/render_config_context.yaml new file mode 100644 index 0000000..e67d323 --- /dev/null +++ b/packs/tests/actions/render_config_context.yaml @@ -0,0 +1,12 @@ +--- +name: render_config_context +runner_type: python-script +description: Action that uses config context +enabled: true +entry_point: render_config_context.py +parameters: + value1: + description: Input for render_config_context. Defaults to config_context value. + required: false + type: "string" + default: "{{ config_context.config_item_one }}" diff --git a/packs/tests/config.schema.yaml b/packs/tests/config.schema.yaml new file mode 100644 index 0000000..2e98ce6 --- /dev/null +++ b/packs/tests/config.schema.yaml @@ -0,0 +1,6 @@ +--- +config_item_one: + description: "Item use to test config context." + type: "string" + required: true + default: "Testing"