aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-12-20 17:05:30 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-12-20 17:08:46 -0500
commitf96638aa20ff83b7800bfa20114aab38996961f3 (patch)
tree86f535fcd3943db0a519a774ba6c75e61101f070
parentdd2cad42b9858404ad42cee9aa92697fbc9bc178 (diff)
downloadb4-f96638aa20ff83b7800bfa20114aab38996961f3.tar.gz
ez: don't crash when there's no [sendemail] section
Do not crash if we do not have a [sendemail] section, which is normal for anyone using a web submission endpoint. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index a489f52..08f9033 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -3046,11 +3046,11 @@ def get_sendemail_config() -> dict:
# Use this identity to override what we got from the default one
sconfig = get_config_from_git(rf'sendemail\.{identity}\..*', defaults=_basecfg)
sectname = f'sendemail.{identity}'
+ if not len(sconfig):
+ raise smtplib.SMTPException('Unable to find %s settings in any applicable git config' % sectname)
else:
sconfig = _basecfg
sectname = 'sendemail'
- if not len(sconfig):
- raise smtplib.SMTPException('Unable to find %s settings in any applicable git config' % sectname)
logger.debug('Using values from %s', sectname)
SENDEMAIL_CONFIG = sconfig