aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann L <yoann.lamouroux@data-impact.fr>2019-11-14 18:39:06 +0100
committerYoann L <yoann.lamouroux@data-impact.fr>2019-11-14 18:39:06 +0100
commit836e04abd6b39390bbe9112095b81b4eee74c610 (patch)
tree6f6e05a2d7442867b1019f77c77722ccb8bb8731
parentdac0bfe786a8d1dfdd97f29d6bb262ed258153fa (diff)
downloadmitmproxy-836e04abd6b39390bbe9112095b81b4eee74c610.tar.gz
mitmproxy-836e04abd6b39390bbe9112095b81b4eee74c610.tar.bz2
mitmproxy-836e04abd6b39390bbe9112095b81b4eee74c610.zip
adding config.yml as an allowed config filename
cf. title as suggested in #3639
-rw-r--r--mitmproxy/tools/_main.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/mitmproxy/tools/_main.py b/mitmproxy/tools/_main.py
index 8a98278d..bcec7327 100644
--- a/mitmproxy/tools/_main.py
+++ b/mitmproxy/tools/_main.py
@@ -17,8 +17,6 @@ from mitmproxy import optmanager
from mitmproxy import proxy
from mitmproxy.utils import debug, arg_check
-OPTIONS_FILE_NAME = "config.yaml"
-
def assert_utf8_env():
spec = ""
@@ -69,6 +67,8 @@ 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,10 +87,11 @@ def run(
sys.exit(1)
try:
opts.set(*args.setoptions, defer=True)
- optmanager.load_paths(
- opts,
- os.path.join(opts.confdir, OPTIONS_FILE_NAME),
- )
+ for conf_file in OPTIONS_FILE_NAMES:
+ optmanager.load_paths(
+ opts,
+ os.path.join(opts.confdir, conf_file),
+ )
pconf = process_options(parser, opts, args)
server: typing.Any = None
if pconf.options.server: