Skip to content

Commit 4f84c0d

Browse files
Merge pull request #2770 from StackStorm/revert-2766-v1.5_user_scoped_params_as_jinja
Revert "Render user params (jinja) in API"
2 parents 0af44d6 + bbef996 commit 4f84c0d

4 files changed

Lines changed: 1 addition & 43 deletions

File tree

CHANGELOG.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ in development
7878
When this flag is provided, all triggers contained within a pack triggers directory are
7979
registered, consistent with the behavior of sensors, actions, etc. This feature allows users
8080
to register trigger types outside the scope of the sensors. (new-feature) [Cody A. Ray]
81-
* Allow user scoped variables to be used as values for parameters in action execution API call.
82-
This also means you can use user scoped variables as values for parameters when you run actions
83-
from CLI or UI. For example, you can now use ``st2 run core.local date='{{user.date_cmd}}'``. (bug-fix)
8481

8582
1.4.0 - April 18, 2016
8683
----------------------

st2common/st2common/util/param.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
from st2common import log as logging
2121
from st2common.constants.action import ACTION_CONTEXT_KV_PREFIX
2222
from st2common.constants.keyvalue import SYSTEM_SCOPE
23-
from st2common.constants.keyvalue import USER_SCOPE
2423
from st2common.exceptions.param import ParamException
2524
from st2common.services.keyvalues import KeyValueLookup
26-
from st2common.services.keyvalues import UserKeyValueLookup
2725
from st2common.util.casts import get_cast
2826
from st2common.util.compat import to_unicode
2927
from st2common.util import jinja as jinja_utils
@@ -77,10 +75,6 @@ def _create_graph(action_context):
7775
'''
7876
G = nx.DiGraph()
7977
G.add_node(SYSTEM_SCOPE, value=KeyValueLookup(scope=SYSTEM_SCOPE))
80-
user = action_context.get('user', None)
81-
LOG.debug('User is: %s', user)
82-
if user:
83-
G.add_node(USER_SCOPE, value=UserKeyValueLookup(user=user, scope=USER_SCOPE))
8478
G.add_node(ACTION_CONTEXT_KV_PREFIX, value=action_context)
8579
return G
8680

st2common/tests/unit/test_param_utils.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@
3232
FIXTURES_PACK = 'generic'
3333

3434
TEST_MODELS = {
35-
'actions': [
36-
'action_4_action_context_param.yaml',
37-
'action_system_default.yaml',
38-
'action_user_default.yaml'
39-
],
35+
'actions': ['action_4_action_context_param.yaml', 'action_system_default.yaml'],
4036
'runners': ['testrunner1.yaml']
4137
}
4238

@@ -48,7 +44,6 @@
4844
class ParamsUtilsTest(DbTestCase):
4945
action_db = FIXTURES['actions']['action_4_action_context_param.yaml']
5046
action_system_default_db = FIXTURES['actions']['action_system_default.yaml']
51-
action_user_default_db = FIXTURES['actions']['action_user_default.yaml']
5247
runnertype_db = FIXTURES['runners']['testrunner1.yaml']
5348

5449
def test_get_finalized_params(self):
@@ -119,23 +114,6 @@ def test_get_finalized_params_system_values(self):
119114
self.assertEqual(action_params.get('actionstr'), 'foo')
120115
self.assertEqual(action_params.get('actionnumber'), 1.0)
121116

122-
def test_get_finalized_params_user_values(self):
123-
KeyValuePair.add_or_update(KeyValuePairDB(name='stanley:foo', value='kabaali',
124-
scope='user'))
125-
params = {
126-
'runnerint': 555
127-
}
128-
liveaction_db = self._get_liveaction_model(params)
129-
liveaction_db.context['user'] = 'stanley'
130-
131-
runner_params, action_params = param_utils.get_finalized_params(
132-
ParamsUtilsTest.runnertype_db.runner_parameters,
133-
ParamsUtilsTest.action_user_default_db.parameters,
134-
liveaction_db.parameters,
135-
liveaction_db.context)
136-
137-
self.assertEqual(action_params.get('actionstr'), 'kabaali')
138-
139117
def test_get_finalized_params_action_immutable(self):
140118
params = {
141119
'actionstr': 'foo',

st2tests/st2tests/fixtures/generic/actions/action_user_default.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)