From d26f6259a7e640c1533d1e4f30edcfa06b635d74 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 17 Oct 2017 13:46:40 -0400 Subject: [PATCH] Add explicit error about certificate mismatch Before we were aborting without info. Now explain the missing information by including the error explaining why it is missing. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index b6e2e109..dfce365e 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -701,9 +701,16 @@ class IpmiHandler(object): def read_firmware(self, component): items = [] - for id, data in self.ipmicmd.get_firmware(): - if component == 'all' or component == simplify_name(id): - items.append({id: data}) + try: + for id, data in self.ipmicmd.get_firmware(): + if component == 'all' or component == simplify_name(id): + items.append({id: data}) + except exc.PubkeyInvalid: + self.output.put(msg.ConfluentNodeError( + self.node, + 'Extended information unavailable, mismatch detected between ' + 'target certificate fingerprint and ' + 'pubkeys.tls_hardwaremanager attribute')) self.output.put(msg.Firmware(items, self.node)) def handle_inventory(self):