

def _extract_images(self, compute):
    '\n        Extract image disks from a compute node XML representation.\n\n        Extract image disk descriptions from a compute node XML representation,\n        converting the disks to an NodeImage object.\n\n        :type  compute: :class:`ElementTree`\n        :param compute: XML representation of a compute node.\n\n        :rtype:  :class:`NodeImage`.\n        :return: First disk attached to a compute node.\n        '
    disks = list()
    disk_list = compute.find('STORAGE')
    if (disk_list is not None):
        for element in disk_list.findall('DISK'):
            disks.append(NodeImage(id=element.attrib.get('image', None), name=None, driver=self.connection.driver, extra={
                'dev': element.attrib.get('dev', None),
            }))
    if (len(disks) > 0):
        return disks[0]
    else:
        return None

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/opennebula.py OpenNebulaNodeDriver._extract_images/original