

def _extract_context(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:  ``dict``\n        :return: Dictionary containing (key, value) pairs related to\n                 compute node context.\n        '
    contexts = dict()
    context = compute.find('CONTEXT')
    if (context is not None):
        for context_element in list(context):
            contexts[context_element.tag.lower()] = context_element.text
    return contexts

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