diff options
author | Maximilian Hils <git@maximilianhils.com> | 2019-11-14 21:12:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-14 21:12:32 +0100 |
commit | c78165bd4c4e3ad89ed603d702c51f6b043b3b60 (patch) | |
tree | 9948691dc254feec2712d238690c41f0e5f07df8 | |
parent | 836e04abd6b39390bbe9112095b81b4eee74c610 (diff) | |
download | mitmproxy-c78165bd4c4e3ad89ed603d702c51f6b043b3b60.tar.gz mitmproxy-c78165bd4c4e3ad89ed603d702c51f6b043b3b60.tar.bz2 mitmproxy-c78165bd4c4e3ad89ed603d702c51f6b043b3b60.zip |
simplify option file loading
- no need for a constant that is only used once
- if load_paths allows us to specify multiple paths, let's just do that.
-rw-r--r-- | mitmproxy/tools/_main.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/mitmproxy/tools/_main.py b/mitmproxy/tools/_main.py index bcec7327..a00a3e98 100644 --- a/mitmproxy/tools/_main.py +++ b/mitmproxy/tools/_main.py @@ -67,8 +67,6 @@ def run( options. """ debug.register_info_dumpers() - # Be tolerant as the yml is often recommended - OPTIONS_FILE_NAMES = ["config.yaml", "config.yml"] opts = options.Options() master = master_cls(opts) @@ -87,11 +85,11 @@ def run( sys.exit(1) try: opts.set(*args.setoptions, defer=True) - for conf_file in OPTIONS_FILE_NAMES: - optmanager.load_paths( - opts, - os.path.join(opts.confdir, conf_file), - ) + optmanager.load_paths( + opts, + os.path.join(opts.confdir, "config.yaml"), + os.path.join(opts.confdir, "config.yml"), + ) pconf = process_options(parser, opts, args) server: typing.Any = None if pconf.options.server: |