@@ -251,7 +251,7 @@ def test_simple_action_no_entry_point(self):
251251 expected_msg = 'Action .*? is missing entry_point attribute'
252252 self .assertRaisesRegexp (Exception , expected_msg , runner .run , {})
253253
254- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
254+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
255255 def test_action_with_user_supplied_env_vars (self , mock_popen ):
256256 env_vars = {'key1' : 'val1' , 'key2' : 'val2' , 'PYTHONPATH' : 'foobar' }
257257
@@ -275,8 +275,8 @@ def test_action_with_user_supplied_env_vars(self, mock_popen):
275275 else :
276276 self .assertEqual (actual_env [key ], value )
277277
278- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
279- @mock .patch ('st2common.util.green.shell.eventlet .spawn' )
278+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
279+ @mock .patch ('st2common.util.concurrency .spawn' )
280280 def test_action_stdout_and_stderr_is_not_stored_in_db_by_default (self , mock_spawn , mock_popen ):
281281 # Feature should be disabled by default
282282 values = {'delimiter' : ACTION_OUTPUT_RESULT_DELIMITER }
@@ -344,8 +344,8 @@ def test_action_stdout_and_stderr_is_not_stored_in_db_by_default(self, mock_spaw
344344 output_dbs = ActionExecutionOutput .get_all ()
345345 self .assertEqual (len (output_dbs ), 0 )
346346
347- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
348- @mock .patch ('st2common.util.green.shell.eventlet .spawn' )
347+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
348+ @mock .patch ('st2common.util.concurrency .spawn' )
349349 def test_action_stdout_and_stderr_is_stored_in_the_db (self , mock_spawn , mock_popen ):
350350 # Feature is enabled
351351 cfg .CONF .set_override (name = 'stream_output' , group = 'actionrunner' , override = True )
@@ -406,7 +406,7 @@ def test_action_stdout_and_stderr_is_stored_in_the_db(self, mock_spawn, mock_pop
406406 self .assertEqual (output_dbs [1 ].data , mock_stderr [1 ])
407407 self .assertEqual (output_dbs [2 ].data , mock_stderr [2 ])
408408
409- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
409+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
410410 def test_stdout_interception_and_parsing (self , mock_popen ):
411411 values = {'delimiter' : ACTION_OUTPUT_RESULT_DELIMITER }
412412
@@ -478,7 +478,7 @@ def test_stdout_interception_and_parsing(self, mock_popen):
478478 self .assertEqual (output ['exit_code' ], 0 )
479479 self .assertEqual (status , 'succeeded' )
480480
481- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
481+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
482482 def test_common_st2_env_vars_are_available_to_the_action (self , mock_popen ):
483483 mock_process = mock .Mock ()
484484 mock_process .communicate .return_value = ('' , '' )
@@ -495,7 +495,7 @@ def test_common_st2_env_vars_are_available_to_the_action(self, mock_popen):
495495 actual_env = call_kwargs ['env' ]
496496 self .assertCommonSt2EnvVarsAvailableInEnv (env = actual_env )
497497
498- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
498+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
499499 def test_pythonpath_env_var_contains_common_libs_config_enabled (self , mock_popen ):
500500 mock_process = mock .Mock ()
501501 mock_process .communicate .return_value = ('' , '' )
@@ -515,7 +515,7 @@ def test_pythonpath_env_var_contains_common_libs_config_enabled(self, mock_popen
515515 self .assertTrue ('PYTHONPATH' in actual_env )
516516 self .assertTrue (pack_common_lib_path in actual_env ['PYTHONPATH' ])
517517
518- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
518+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
519519 def test_pythonpath_env_var_not_contains_common_libs_config_disabled (self , mock_popen ):
520520 mock_process = mock .Mock ()
521521 mock_process .communicate .return_value = ('' , '' )
@@ -806,7 +806,7 @@ def test_content_version_success(self, mock_get_sandbox_virtualenv_path):
806806 self .assertRaisesRegexp (ValueError , expected_msg , runner .pre_run )
807807
808808 @mock .patch ('python_runner.python_runner.get_sandbox_virtualenv_path' )
809- @mock .patch ('st2common.util.green.shell.subprocess.Popen ' )
809+ @mock .patch ('st2common.util.concurrency.subprocess_popen ' )
810810 def test_content_version_contains_common_libs_config_enabled (self , mock_popen ,
811811 mock_get_sandbox_virtualenv_path ):
812812 # Verify that the common libs path correctly reflects directory in git worktree
0 commit comments