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:05:30 -0500
commit3355470ca6455158647a7c3f65c91bfaee352ee7 (patch)
tree00e1bf08e604f7c233061f32d420c67449604d3e
parent0516639f61ba5306c86fe55a5955a1515bf260db (diff)
downloadb4-3355470ca6455158647a7c3f65c91bfaee352ee7.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 20c47c1..be7ca14 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