Skip to content

Commit

Permalink
issue openwallet-foundation#3182: allow to debug provision and upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Ricky Ng-Adam <ricky.ng-adam-ext@mcn.gouv.qc.ca>
  • Loading branch information
rngadam committed Aug 21, 2024
1 parent b9bb410 commit 7cf389b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion aries_cloudagent/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def init_debug(args):
import debugpy

debugpy.listen((PTVSD_HOST, PTVSD_PORT))
print("=== Waiting for debugger to attach ===")
print(f"=== Waiting for debugger to attach to {PTVSD_HOST}:{PTVSD_PORT} ===")
debugpy.wait_for_client()
except ImportError:
print("debugpy library was not found")
Expand Down
28 changes: 21 additions & 7 deletions aries_cloudagent/config/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,11 @@ def get_settings(self, args: Namespace):
)
return settings

@group(CAT_PROVISION, CAT_START, CAT_UPGRADE)
class DebuggerGroup(ArgumentGroup):
"""Debugger settings."""

@group(CAT_START)
class DebugGroup(ArgumentGroup):
"""Debug settings."""

GROUP_NAME = "Debug"
GROUP_NAME = "Debugger"

def add_arguments(self, parser: ArgumentParser):
"""Add debug command line arguments to the parser."""
Expand All @@ -232,6 +231,23 @@ def add_arguments(self, parser: ArgumentParser):
"for the debugger to connect at start-up. Default: false."
),
)

def get_settings(self, args: Namespace) -> dict:
"""Extract debug settings."""
settings = {}
if args.debug:
settings["debug.enabled"] = True
return settings


@group(CAT_START)
class DebugGroup(ArgumentGroup):
"""Debug settings."""

GROUP_NAME = "Debug"

def add_arguments(self, parser: ArgumentParser):
"""Add debug command line arguments to the parser."""
parser.add_argument(
"--debug-seed",
dest="debug_seed",
Expand Down Expand Up @@ -415,8 +431,6 @@ def add_arguments(self, parser: ArgumentParser):
def get_settings(self, args: Namespace) -> dict:
"""Extract debug settings."""
settings = {}
if args.debug:
settings["debug.enabled"] = True
if args.debug_connections:
settings["debug.connections"] = True
if args.debug_credentials:
Expand Down

0 comments on commit 7cf389b

Please sign in to comment.