aboutsummaryrefslogtreecommitdiff
path: root/b4/__init__.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-23 15:56:45 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-23 15:56:45 -0500
commit521d4712ef531d13a68760bcd666f9056a14348e (patch)
tree1766e80e29069ee42b375695ebc07026d782025b /b4/__init__.py
parent816375b5a8fb342324d3fd1cc6630f2fde7483da (diff)
downloadb4-521d4712ef531d13a68760bcd666f9056a14348e.tar.gz
Tweak display in softfail mode
Don't display failures if there are no attestations available. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/__init__.py')
-rw-r--r--b4/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index 2069e81..edd6c0c 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -537,20 +537,20 @@ class LoreSeries:
logger.info(' %s %s', attpass, lmsg.full_subject)
attdata[at-1] = (latt.lsig.attestor.get_trailer(lmsg.fromemail), attpass) # noqa
else:
- if attpolicy in ('softfail', 'hardfail'):
+ if latt and latt.lsig and attpolicy in ('softfail', 'hardfail'):
logger.info(' %s %s', attfail, lmsg.full_subject)
- failed = list()
if latt and latt.lsig and latt.lsig.attestor and latt.lsig.attestor.mode == 'domain':
- failed.append(latt.lsig.attestor.get_trailer())
- else:
+ atterrors.append('Failed %s attestation' % latt.lsig.attestor.get_trailer())
+ elif latt and latt.lsig and latt.lsig.attestor:
+ failed = list()
if not latt.pv:
failed.append('patch content')
if not latt.mv:
failed.append('commit message')
if not latt.iv:
failed.append('patch metadata')
- atterrors.append('Patch %s/%s failed attestation (%s)' % (at, lmsg.expected,
- ', '.join(failed)))
+ atterrors.append('Patch %s/%s failed attestation (%s)' % (at, lmsg.expected,
+ ', '.join(failed)))
else:
logger.info(' %s', lmsg.full_subject)
else: