Best Python code snippet using avocado_python
pci.py
Source:pci.py  
...63        for line in output.splitlines():64            if filt in line:65                count += 166        return count67def get_disks_in_pci_address(pci_address):68    """69    Gets disks in a PCI address.70    :param pci_address: Any segment of a PCI address (1f, 0000:00:1f, ...)71    :return: list of disks in a PCI address.72    """73    disks_path = "/dev/disk/by-path/"74    disk_list = []75    for dev in os.listdir(disks_path):76        if pci_address in dev:77            link = os.readlink(os.path.join(disks_path, dev))78            disk_list.append(os.path.abspath(os.path.join(disks_path, link)))79    return disk_list80def get_nics_in_pci_address(pci_address):81    """...pci_hotplug.py
Source:pci_hotplug.py  
...125                return True126            curr_path = ''127            err_disks = []128            if pci.get_pci_class_name(pci_addr) == 'fc_host':129                disks = pci.get_disks_in_pci_address(pci_addr)130                for disk in disks:131                    curr_path = disk.split("/")[-1]132                    self.log.info("curr_path=%s" % curr_path)133                    if not wait.wait_for(is_path_online, timeout=10):134                        self.log.info("%s failed to recover after add" % disk)135                        err_disks.append(disk)136            if err_disks:137                self.log.info("few paths failed to recover : %s" % err_disks)138                return False139            return True140        def net_recovery_check():141            """142            Checks if the network adapter fuctionality like ping/link_state,143            after adapter added back....Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
