From 66f934fc6addd49e259679c30a5351334ad52b64 Mon Sep 17 00:00:00 2001 From: Sheshagiri Date: Wed, 13 May 2020 19:04:28 +0530 Subject: [PATCH 1/4] fix netstat action in linux pack --- contrib/linux/actions/netstat.yaml | 1 + contrib/linux/actions/netstat_grep.yaml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/linux/actions/netstat.yaml b/contrib/linux/actions/netstat.yaml index 98dc695046..3c370f2475 100644 --- a/contrib/linux/actions/netstat.yaml +++ b/contrib/linux/actions/netstat.yaml @@ -11,3 +11,4 @@ args: description: "Command line arguments" default: " " + type: "string" diff --git a/contrib/linux/actions/netstat_grep.yaml b/contrib/linux/actions/netstat_grep.yaml index 6a7c83981f..d3d730c4a8 100644 --- a/contrib/linux/actions/netstat_grep.yaml +++ b/contrib/linux/actions/netstat_grep.yaml @@ -9,5 +9,6 @@ immutable: true default: "for pid in {{pids}}; do netstat -pant | grep $pid; done; exit 0" pids: - description: "List of pids" + description: "List of pids. ex: [1111, 2222]" required: true + type: "array" From 9db483c48695cef2684db597851bdd5c3c5fc8a9 Mon Sep 17 00:00:00 2001 From: Sheshagiri Date: Wed, 13 May 2020 19:29:33 +0530 Subject: [PATCH 2/4] update change log --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4bddfa3185..eb47978e58 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,10 @@ Added Fixed ~~~~~ +* Fixed a bug where `type` attribute was missing for netstat action in linux pack. Fixes #4946 + + Reported by @scguoi and contributed by Sheshagiri (@sheshagiri) + * Fixed a bug where persisting Orquesta to the MongoDB database returned an error ``message: key 'myvar.with.period' must not contain '.'``. This happened anytime an ``input``, ``output``, ``publish`` or context ``var`` contained a key with a ``.`` within From edcb98aab99a52aed24671fa90768bc9b34d8c85 Mon Sep 17 00:00:00 2001 From: Sheshagiri Date: Wed, 13 May 2020 21:44:00 +0530 Subject: [PATCH 3/4] fix lint errors in st2common --- st2common/st2common/util/monkey_patch.py | 2 +- st2common/tests/unit/test_dist_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/st2common/st2common/util/monkey_patch.py b/st2common/st2common/util/monkey_patch.py index 14974ba834..eab537be27 100644 --- a/st2common/st2common/util/monkey_patch.py +++ b/st2common/st2common/util/monkey_patch.py @@ -79,7 +79,7 @@ def use_select_poll_workaround(nose_only=True): import eventlet # Work around to get tests to pass with eventlet >= 0.20.0 - if not nose_only or (nose_only and'nose' in sys.modules.keys()): + if not nose_only or (nose_only and 'nose' in sys.modules.keys()): # Add back blocking poll() to eventlet monkeypatched select original_poll = eventlet.patcher.original('select').poll select.poll = original_poll diff --git a/st2common/tests/unit/test_dist_utils.py b/st2common/tests/unit/test_dist_utils.py index 9cd2b1bcf8..1427818a62 100644 --- a/st2common/tests/unit/test_dist_utils.py +++ b/st2common/tests/unit/test_dist_utils.py @@ -44,7 +44,7 @@ class DistUtilsTestCase(unittest2.TestCase): def setUp(self): super(DistUtilsTestCase, self).setUp() - if 'pip'in sys.modules: + if 'pip' in sys.modules: del sys.modules['pip'] def tearDown(self): From 763c0f570f395d507738aba8e9ee6f6f3d263012 Mon Sep 17 00:00:00 2001 From: Sheshagiri Date: Wed, 13 May 2020 23:40:41 +0530 Subject: [PATCH 4/4] fix lint error in contrib --- contrib/runners/orquesta_runner/orquesta_functions/st2kv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/runners/orquesta_runner/orquesta_functions/st2kv.py b/contrib/runners/orquesta_runner/orquesta_functions/st2kv.py index 3dbb12d071..31fcc5cae0 100644 --- a/contrib/runners/orquesta_runner/orquesta_functions/st2kv.py +++ b/contrib/runners/orquesta_runner/orquesta_functions/st2kv.py @@ -43,8 +43,8 @@ def st2kv_(context, key, **kwargs): try: user_db = auth_db_access.User.get(username) except Exception as e: - raise Exception('Failed to retrieve User object for user "%s" % (username)' % - (six.text_type(e))) + raise Exception('Failed to retrieve User object for user "%s", "%s"' % + (username, six.text_type(e))) has_default = 'default' in kwargs default_value = kwargs.get('default')