diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-12-20 17:05:30 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-12-20 17:05:30 -0500 |
commit | 3355470ca6455158647a7c3f65c91bfaee352ee7 (patch) | |
tree | 00e1bf08e604f7c233061f32d420c67449604d3e | |
parent | 0516639f61ba5306c86fe55a5955a1515bf260db (diff) | |
download | b4-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__.py | 4 |
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 |