Example #1
0
def upload_tracer_profile(queryfunc, plugin):
    uep = get_uep()
    consumer_id = lookup_consumer_id()
    if consumer_id is None:
        sys.stderr.write("Cannot upload tracer data, is this client registered?\n")
    else:
        method = '/consumers/%s/tracer' % uep.sanitize(consumer_id)
        data = {"traces": get_apps(queryfunc, plugin)}
        uep.conn.request_put(method, data)
Example #2
0
def upload_tracer_profile(queryfunc, plugin=None):
    uep = get_uep()
    consumer_id = lookup_consumer_id()
    if consumer_id is None:
        sys.stderr.write(
            "Cannot upload tracer data, is this client registered?\n")
    else:
        method = '/consumers/%s/tracer' % uep.sanitize(consumer_id)
        data = {"traces": get_apps(queryfunc, plugin)}
        uep.conn.request_put(method, data)
Example #3
0
def report_enabled_repos(consumer_id, report):
    """
    Report enabled repositories to the UEP.
    :param consumer_id: The consumer ID.
    :type consumer_id: str
    :param report: The report to send.
    :type report: dict
    """
    uep = get_uep()
    method = '/systems/%s/enabled_repos' % uep.sanitize(consumer_id)
    try:
        uep.conn.request_put(method, report)
    except (RemoteServerException, GoneException):
        error = sys.exc_info()[
            1]  # backward and forward compatible way to get the exception
        error_message(str(error))
Example #4
0
def upload_tracer_profile(queryfunc, plugin):
    uep = get_uep()

    method = '/consumers/%s/tracer' % uep.sanitize(lookup_consumer_id())
    data = {"traces": get_apps(queryfunc, plugin)}
    uep.conn.request_put(method, data)