def add_slot_ports(self, slot):
        """
        Add the ports to be added for a adapter card

        :param str slot: Slot name
        """
        slot_nb = int(slot[4])
        # slot_adapter = None
        # if slot in self.node['properties']:
        #     slot_adapter = self.node['properties'][slot]
        # elif self.device_info['model'] == 'c7200':
        #     if self.device_info['npe'] == 'npe-g2':
        #         slot_adapter = 'C7200-IO-GE-E'
        #     else:
        #         slot_adapter = 'C7200-IO-2FE'

        slot_adapter = self.node['properties'][slot]

        num_ports = ADAPTER_MATRIX[slot_adapter]['ports']
        port_type = ADAPTER_MATRIX[slot_adapter]['type']
        ports = []

        for i in range(num_ports):
            port_name = PORT_TYPES[port_type] + '%s/%s' % (slot_nb, i)
            port_temp = {'name': port_name,
                         'id': self.port_id,
                         'port_number': i,
                         'slot_number': slot_nb}
            ports.append(port_temp)
            self.port_id += 1
        self.node['ports'].extend(ports)
def add_slot_ports ( self , slot ) : slot_nb = int ( slot [ 4 ] ) slot_adapter = self . node [ 'properties' ] [ slot ] num_ports = ADAPTER_MATRIX [ slot_adapter ] [ 'ports' ] port_type = ADAPTER_MATRIX [ slot_adapter ] [ 'type' ] ports = [ ] for i in range ( num_ports ) : port_name = PORT_TYPES [ port_type ] + '%s/%s' % ( slot_nb , i ) port_temp = { 'name' : port_name , 'id' : self . port_id , 'port_number' : i , 'slot_number' : slot_nb } ports . append ( port_temp ) self . port_id += 1 self . node [ 'ports' ] . extend ( ports )
Add the ports to be added for a adapter card

        :param str slot: Slot name