Commit 70103358 authored by juga's avatar juga
Browse files

chg: config: Stop printing which config file is used

sbws doesn't use default logging configuration until it tries to read
configuration files. However it prints to stdout which configuration
file is being used before that.
If an sbws' operator wish to only receive emails on warnings, they'll
still receive emails because of the print line. Therefore stop printing
before configuring logging.

Closes #40110.
parent 64c22724
Pipeline #23233 passed with stages
in 17 minutes and 57 seconds
......@@ -81,16 +81,18 @@ def _get_user_config(args, conf=None):
if not os.path.isfile(args.config):
# XXX: The logger is not configured at this stage,
# sbws should start with a logger before reading configurations.
# #40110: while the log is not configured, do not print, so that
# no output is generated unless there're warnings.
"Configuration file %s not found, using defaults."
% args.config
return conf
print("Using configuration provided as argument %s" % args.config)
# print("Using configuration provided as argument %s" % args.config)
return _extend_config(conf, args.config)
user_config_path = _obtain_user_conf_path()
if os.path.isfile(user_config_path):
print("Using configuration file %s" % user_config_path)
# print("Using configuration file %s" % user_config_path)
return _extend_config(conf, user_config_path)
log.debug("No user config found, using defaults.")
return conf
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment