def _discover_device(self): """Discover the device.""" try: error_message = fcoe.add_san(self._nic, self._dcb, self._auto_vlan) except (IOError, OSError) as e: raise StorageDiscoveryError(str(e)) from e if error_message: raise StorageDiscoveryError(error_message) fcoe.added_nics.append(self._nic)
def _discover_device(self): """Discover the device.""" try: error_message = fcoe.add_san(self._nic, self._dcb, self._auto_vlan) except (IOError, OSError) as e: raise StorageDiscoveryError(str(e)) if error_message: raise StorageDiscoveryError(error_message) fcoe.added_nics.append(self._nic)
def parse(self, args): fc = super().parse(args) if fc.nic not in nm.nm_devices(): raise KickstartParseError(_("NIC \"{}\" given in fcoe command does not " "exist.").format(fc.nic), lineno=self.lineno) if fc.nic in (info[0] for info in fcoe.nics): log.info("Kickstart fcoe device %s was already added from EDD, ignoring.", fc.nic) else: msg = fcoe.add_san(nic=fc.nic, dcb=fc.dcb, auto_vlan=True) if not msg: msg = "Succeeded." fcoe.added_nics.append(fc.nic) log.info("Adding FCoE SAN on %s: %s", fc.nic, msg) return fc
def parse(self, args): fc = super().parse(args) if fc.nic not in [dev.device_name for dev in get_supported_devices()]: raise KickstartParseError(_( "NIC \"{}\" given in fcoe command does not " "exist.").format(fc.nic), lineno=self.lineno) if fc.nic in (info[0] for info in fcoe.nics): log.info( "Kickstart fcoe device %s was already added from EDD, ignoring.", fc.nic) else: msg = fcoe.add_san(nic=fc.nic, dcb=fc.dcb, auto_vlan=True) if not msg: msg = "Succeeded." fcoe.added_nics.append(fc.nic) log.info("Adding FCoE SAN on %s: %s", fc.nic, msg) return fc