44
55import argparse
66import atexit
7- import json
87import logging
98import os
109import re
@@ -56,9 +55,9 @@ def format_taskgraph_labels(taskgraph):
5655
5756
5857def format_taskgraph_json (taskgraph ):
59- return json . dumps (
60- taskgraph . to_json (), sort_keys = True , indent = 2 , separators = ( "," , ": " )
61- )
58+ from taskgraph . util import json
59+
60+ return json . dumps ( taskgraph . to_json (), sort_keys = True , indent = 2 )
6261
6362
6463def format_taskgraph_yaml (taskgraph ):
@@ -757,6 +756,7 @@ def actions(args):
757756 from taskgraph .actions import render_actions_json
758757 from taskgraph .generator import TaskGraphGenerator
759758 from taskgraph .parameters import parameters_loader
759+ from taskgraph .util import json
760760
761761 if args .pop ("verbose" , False ):
762762 logging .root .setLevel (logging .DEBUG )
@@ -766,7 +766,7 @@ def actions(args):
766766 tgg = TaskGraphGenerator (root_dir = args .get ("root" ), parameters = parameters )
767767
768768 actions = render_actions_json (tgg .parameters , tgg .graph_config , "DECISION-TASK" )
769- print (json .dumps (actions , sort_keys = True , indent = 2 , separators = ( "," , ": " ) ))
769+ print (json .dumps (actions , sort_keys = True , indent = 2 ))
770770 except Exception :
771771 traceback .print_exc ()
772772 sys .exit (1 )
@@ -784,6 +784,7 @@ def actions(args):
784784def action_callback (options ):
785785 from taskgraph .actions import trigger_action_callback
786786 from taskgraph .actions .util import get_parameters
787+ from taskgraph .util import json
787788
788789 try :
789790 # the target task for this action (or null if it's a group action)
@@ -833,7 +834,7 @@ def test_action_callback(options):
833834 import taskgraph .actions
834835 import taskgraph .parameters
835836 from taskgraph .config import load_graph_config
836- from taskgraph .util import yaml
837+ from taskgraph .util import json , yaml
837838
838839 def load_data (filename ):
839840 with open (filename ) as f :
0 commit comments