diff --git a/confluent_server/confluent/exceptions.py b/confluent_server/confluent/exceptions.py index 47f9efdf..6364db7d 100644 --- a/confluent_server/confluent/exceptions.py +++ b/confluent_server/confluent/exceptions.py @@ -100,6 +100,7 @@ class PubkeyInvalid(ConfluentException): def __init__(self, text, certificate, fingerprint, attribname, event): super(PubkeyInvalid, self).__init__(self, text) self.fingerprint = fingerprint + self.attrname = attribname bodydata = {'message': text, 'event': event, 'fingerprint': fingerprint, diff --git a/confluent_server/confluent/firmwaremanager.py b/confluent_server/confluent/firmwaremanager.py index f98ae7b3..06988f49 100644 --- a/confluent_server/confluent/firmwaremanager.py +++ b/confluent_server/confluent/firmwaremanager.py @@ -31,6 +31,11 @@ def execupdate(handler, filename, updateobj): if completion is None: completion = 'complete' updateobj.handle_progress({'phase': completion, 'progress': 100.0}) + except exc.PubkeyInvalid as pi: + errstr = 'Certificate mismatch detected, does not match value in ' \ + 'attribute {0}'.format(pi.attrname) + updateobj.handle_progress({'phase': 'error', 'progress': 0.0, + 'detail': errstr}) except Exception as e: updateobj.handle_progress({'phase': 'error', 'progress': 0.0, 'detail': str(e)})