Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Added
* Added graceful shutdown for workflow engine. #5463
Contributed by @khushboobhatia01

* Add ``ST2_USE_DEBUGGER`` env var as alternative to the ``--use-debugger`` cli flag. #5675
Contributed by @cognifloyd

Changed
~~~~~~~

Expand Down
6 changes: 6 additions & 0 deletions st2common/st2common/util/monkey_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from __future__ import absolute_import

import os
import sys

__all__ = [
Expand All @@ -29,6 +30,7 @@

USE_DEBUGGER_FLAG = "--use-debugger"
PARENT_ARGS_FLAG = "--parent-args="
USE_DEBUGGER_ENV_VAR = "ST2_USE_DEBUGGER"


def monkey_patch(patch_thread=None):
Expand Down Expand Up @@ -117,4 +119,8 @@ def is_use_debugger_flag_provided():
if arg.startswith(PARENT_ARGS_FLAG) and USE_DEBUGGER_FLAG in arg:
return True

# 3. Check for ST2_USE_DEBUGGER env var
if os.environ.get(USE_DEBUGGER_ENV_VAR, False):
return True

return False