ironic_inspector/plugins/standard.py
def _validate_interfaces(self, interfaces, data=None):
        """Validate interfaces on correctness and suitability.

        :return: dict interface name -> dict with keys 'mac' and 'ip'
        """
        if not interfaces:
            raise utils.Error(_('No interfaces supplied by the ramdisk'),
                              data=data)

        pxe_mac = utils.get_pxe_mac(data)
        if not pxe_mac and CONF.processing.add_ports == 'pxe':
            LOG.warning('No boot interface provided in the introspection '
                        'data, will add all ports with IP addresses')

        result = {}

        for name, iface in interfaces.items():
            ip = iface.get('ip')
            pxe = iface.get('pxe', True)

            if name == 'lo' or (ip and netaddr.IPAddress(ip).is_loopback()):
                LOG.debug('Skipping local interface %s', name, data=data)
                continue

            if CONF.processing.add_ports == 'pxe' and pxe_mac and not pxe:
                LOG.debug('Skipping interface %s as it was not PXE booting',
                          name, data=data)
                continue
            elif CONF.processing.add_ports != 'all' and not ip:
                LOG.debug('Skipping interface %s as it did not have '
                          'an IP address assigned during the ramdisk run',
                          name, data=data)
                continue

            result[name] = iface

        if not result:
            raise utils.Error(_('No suitable interfaces found in %s') %
                              interfaces, data=data)
        return result
Validate interfaces on correctness and suitability.

        :return: dict interface name -> dict with keys 'mac' and 'ip'
        
Validate interfaces on correctness and suitability.
Validate interfaces on correctness and suitability .
def _validate_interfaces(self, interfaces, data=None):
        if not interfaces:
            raise utils.Error(_('No interfaces supplied by the ramdisk'),
                              data=data)
        pxe_mac = utils.get_pxe_mac(data)
        if not pxe_mac and CONF.processing.add_ports == 'pxe':
            LOG.warning('No boot interface provided in the introspection '
                        'data, will add all ports with IP addresses')
        result = {}
        for name, iface in interfaces.items():
            ip = iface.get('ip')
            pxe = iface.get('pxe', True)
            if name == 'lo' or (ip and netaddr.IPAddress(ip).is_loopback()):
                LOG.debug('Skipping local interface %s', name, data=data)
                continue
            if CONF.processing.add_ports == 'pxe' and pxe_mac and not pxe:
                LOG.debug('Skipping interface %s as it was not PXE booting',
                          name, data=data)
                continue
            elif CONF.processing.add_ports != 'all' and not ip:
                LOG.debug('Skipping interface %s as it did not have '
                          'an IP address assigned during the ramdisk run',
                          name, data=data)
                continue
            result[name] = iface
        if not result:
            raise utils.Error(_('No suitable interfaces found in %s') %
                              interfaces, data=data)
        return result
def _validate_interfaces ( self , interfaces , data = None ) : if not interfaces : raise utils . Error ( _ ( 'No interfaces supplied by the ramdisk' ) , data = data ) pxe_mac = utils . get_pxe_mac ( data ) if not pxe_mac and CONF . processing . add_ports == 'pxe' : LOG . warning ( 'No boot interface provided in the introspection ' 'data, will add all ports with IP addresses' ) result = { } for name , iface in interfaces . items ( ) : ip = iface . get ( 'ip' ) pxe = iface . get ( 'pxe' , True ) if name == 'lo' or ( ip and netaddr . IPAddress ( ip ) . is_loopback ( ) ) : LOG . debug ( 'Skipping local interface %s' , name , data = data ) continue if CONF . processing . add_ports == 'pxe' and pxe_mac and not pxe : LOG . debug ( 'Skipping interface %s as it was not PXE booting' , name , data = data ) continue elif CONF . processing . add_ports != 'all' and not ip : LOG . debug ( 'Skipping interface %s as it did not have ' 'an IP address assigned during the ramdisk run' , name , data = data ) continue result [ name ] = iface if not result : raise utils . Error ( _ ( 'No suitable interfaces found in %s' ) % interfaces , data = data ) return result
Validate interfaces on correctness and suitability.
Validate interfaces on correctness and suitability .
"""Validate interfaces on correctness and suitability.

        :return: dict interface name -> dict with keys 'mac' and 'ip'
        """
dict interface name -> dict with keys 'mac' and 'ip'
dict interface name - > dict with keys ' mac ' and ' ip '
self
interfaces
data