This repository was archived by the owner on May 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ Reasons to use a configuration file:
211211
212212- Convenience - Set-up the parameters for diffs that need to run often
213213
214- - Easier and more readible - You can define the database connection settings as config values, instead of in a URI.
214+ - Easier and more readable - you can define the database connection settings as config values, instead of in a URI.
215215
216216- Gives you fine-grained control over the settings switches, without requiring any Python code.
217217
Original file line number Diff line number Diff line change 1+ from copy import deepcopy
12import sys
23import time
34import json
2526 "-" : "red" ,
2627}
2728
29+ def _remove_passwords_in_dict (d : dict ):
30+ for k , v in d .items ():
31+ if k == 'password' :
32+ d [k ] = '*' * len (v )
33+ elif isinstance (v , dict ):
34+ _remove_passwords_in_dict (v )
35+
2836
2937@click .command ()
3038@click .argument ("database1" , required = False )
@@ -110,6 +118,8 @@ def _main(
110118 if debug :
111119 logging .basicConfig (level = logging .DEBUG , format = LOG_FORMAT , datefmt = DATE_FORMAT )
112120 if __conf__ :
121+ __conf__ = deepcopy (__conf__ )
122+ _remove_passwords_in_dict (__conf__ )
113123 logging .debug (f"Applied run configuration: { __conf__ } " )
114124 elif verbose :
115125 logging .basicConfig (level = logging .INFO , format = LOG_FORMAT , datefmt = DATE_FORMAT )
You can’t perform that action at this time.
0 commit comments