def _parse_snapshot_description(snapshot, unix_time=False):
    ret = dict()
    tree = ElementTree.fromstring(snapshot.getXMLDesc())
    for node in tree:
        if node.tag == 'name':
            ret['name'] = node.text
        elif node.tag == 'creationTime':
            ret['created'] = not unix_time and datetime.datetime.fromtimestamp(
                float(node.text)).isoformat(' ') or float(node.text)
        elif node.tag == 'state':
            ret['running'] = node.text == 'running'

    ret['current'] = snapshot.isCurrent() == 1

    return ret
Parse XML doc and return a dict with the status values.
dataset/ETHPy150Open saltstack/salt/salt/modules/virt.py/_parse_snapshot_description