

def _extract_size(self, compute):
    '\n        Extract size, or node type, from a compute node XML representation.\n\n        Extract node size, or node type, description from a compute node XML\n        representation, converting the node size to a NodeSize object.\n\n        :type  compute: :class:`ElementTree`\n        :param compute: XML representation of a compute node.\n\n        :rtype:  :class:`OpenNebulaNodeSize`\n        :return: Node type of compute node.\n        '
    instance_type = compute.find('INSTANCE_TYPE')
    try:
        return next((node_size for node_size in self.list_sizes() if (node_size.name == instance_type.text)))
    except StopIteration:
        return None

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/opennebula.py OpenNebula_2_0_NodeDriver._extract_size/original