Skip to content

Commit 3affdd7

Browse files
committed
Fixed config.yaml default regression
1 parent c15902c commit 3affdd7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

elastalert/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ def load_conf(args, defaults=None, overwrites=None):
4141
:return: The global configuration, a dictionary.
4242
"""
4343
filename = args.config
44-
conf = yaml_loader(filename)
44+
if filename:
45+
conf = yaml_loader(filename)
46+
else:
47+
try:
48+
conf = yaml_loader('config.yaml')
49+
except FileNotFoundError:
50+
raise EAException('No --config or config.yaml found')
4551

4652
# init logging from config and set log levels according to command line options
4753
configure_logging(args, conf)

0 commit comments

Comments
 (0)