def retrieve_firmware(configmanager, creds, node, results, element): if len(element) == 3: results.put(msg.ChildCollection('all')) return wc = WebClient(node, configmanager, creds) fwinfo = wc.fetch('/affluent/inventory/firmware/all', results) if fwinfo: results.put(msg.Firmware(fwinfo, node))
def retrieve_firmware(configmanager, creds, node, results, element): if len(element) == 3: results.put(msg.ChildCollection('all')) return wc = cnos_login(node, configmanager, creds) sysinfo = wc.grab_json_response('/nos/api/sysinfo/inventory') items = [{ 'Software': { 'version': sysinfo['Software Revision'] }, }, { 'BIOS': { 'version': sysinfo['BIOS Revision'] }, }] results.put(msg.Firmware(items, node))
def read_firmware(self, component): items = [] errorneeded = False try: complist = () if component == 'all' else (component,) for id, data in self.ipmicmd.get_firmware(complist): if (component in ('core', 'all') or component == simplify_name(id)): items.append({id: data}) except ssl.SSLEOFError: errorneeded = msg.ConfluentNodeError( self.node, 'Unable to communicate with the https server on ' 'the target BMC while trying to read extended ' 'information') except exc.PubkeyInvalid: errorneeded = 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)) if errorneeded: self.output.put(errorneeded)
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}) self.output.put(msg.Firmware(items, self.node))