Exemplo n.º 1
0
Arquivo: aq.py Projeto: piojo/aquilon
        query_index = uri.find("?")
        if query_index > -1:
            uri = uri[:query_index] + extension + uri[query_index:]
        else:
            uri = uri + extension

    authuser = globalOptions.get("auth") and aqservice or None
    # create HTTP connection object adhering to the command line request
    if authuser:
        conn = KNCHTTPConnection(host, port, authuser)
    else:
        conn = ChunkedHTTPConnection(host, port)

    if globalOptions.get("debug"):
        conn.set_debuglevel(10)

    # run custom command if there's one
    if transport.custom:
        action = CustomAction(transport.custom, globalOptions)
        action.run(commandOptions)

    status_thread = None
    # Kick off a thread to (potentially) get status...
    # Spare a second connection to the server for read-only commands that use
    # the "GET" method
    if command == "show_request" or (transport.method != "get" and globalOptions.get("verbose")):
        status_thread = StatusThread(host, port, authuser, **commandOptions)

    if command == "show_request":
        status_thread.outstream = sys.stdout
Exemplo n.º 2
0
        query_index = uri.find('?')
        if query_index > -1:
            uri = uri[:query_index] + extension + uri[query_index:]
        else:
            uri = uri + extension

    authuser = globalOptions.get('auth') and aqservice or None
    # create HTTP connection object adhering to the command line request
    if authuser:
        conn = KNCHTTPConnection(host, port, authuser)
    else:
        conn = ChunkedHTTPConnection(host, port)

    if globalOptions.get('debug'):
        conn.set_debuglevel(10)

    # run custom command if there's one
    if transport.custom:
        action = CustomAction(transport.custom, globalOptions)
        action.run(commandOptions)

    status_thread = None
    # Kick off a thread to (potentially) get status...
    # Spare a second connection to the server for read-only commands that use
    # the "GET" method
    if command == "show_request" or (transport.method != "get" and \
                                     globalOptions.get("verbose")):
        status_thread = StatusThread(host, port, authuser, **commandOptions)

    if command == "show_request":