'Get all the networks.
If it is an admin user then api will return all the
networks. If it is a normal user and nova Flat or FlatDHCP
networking is being used then api will return all
networks. Otherwise api will only return the networks which
belong to the user\'s project.'

def get_all(self, context):

    if ('nova.network.manager.Flat' in CONF.network_manager):
        project_only = 'allow_none'
    else:
        project_only = True
    try:
        return objects.NetworkList.get_all(context, project_only=project_only)
    except exception.NoNetworksFound:
        return []
