Lists all virtual networks available to the user and the user's groups.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_vns opennebula

def list_vns(call=None):
    '''
    Lists all virtual networks available to the user and the user's groups.

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_vns opennebula
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_vns function must be called with -f or --function.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    vn_pool = server.one.vnpool.info(auth, -2, -1, -1)[1]

    vns = {}
    for v_network in _get_xml(vn_pool):
        vns[v_network.find('NAME').text] = _xml_to_dict(v_network)

    return vns