コード例 #1
0
ファイル: fetch.py プロジェクト: knettix/munki
        raise
    except Exception, err:  # too general, I know
        # Let us out! ... Safely! Unexpectedly quit dialogs are annoying...
        connection.cancel()
        # Re-raise the error as a GurlError
        raise GurlError(-1, str(err))

    if connection.error != None:
        # Gurl returned an error
        munkicommon.display_detail('Download error %s: %s',
                                   connection.error.code(),
                                   connection.error.localizedDescription())
        if connection.SSLerror:
            munkicommon.display_detail('SSL error detail: %s',
                                       str(connection.SSLerror))
            keychain.debug_output()
        munkicommon.display_detail('Headers: %s', connection.headers)
        if os.path.exists(tempdownloadpath) and not resume:
            os.remove(tempdownloadpath)
        raise GurlError(connection.error.code(),
                        connection.error.localizedDescription())

    if connection.response != None:
        munkicommon.display_debug1('Status: %s', connection.status)
        munkicommon.display_debug1('Headers: %s', connection.headers)
    if connection.redirection != []:
        munkicommon.display_debug1('Redirection: %s', connection.redirection)

    temp_download_exists = os.path.isfile(tempdownloadpath)
    connection.headers['http_result_code'] = str(connection.status)
    description = NSHTTPURLResponse.localizedStringForStatusCode_(
コード例 #2
0
ファイル: fetch.py プロジェクト: macgurudev/munki
        raise
    except Exception, err: # too general, I know
        # Let us out! ... Safely! Unexpectedly quit dialogs are annoying...
        connection.cancel()
        # Re-raise the error as a GurlError
        raise GurlError(-1, str(err))

    if connection.error != None:
        # Gurl returned an error
        munkicommon.display_detail(
            'Download error %s: %s', connection.error.code(), 
            connection.error.localizedDescription())
        if connection.SSLerror:
            munkicommon.display_detail(
                'SSL error detail: %s', str(connection.SSLerror))
            keychain.debug_output()
        munkicommon.display_detail('Headers: %s', connection.headers)
        if os.path.exists(tempdownloadpath) and not resume:
            os.remove(tempdownloadpath)
        raise GurlError(connection.error.code(), 
                        connection.error.localizedDescription())

    if connection.response != None:
        munkicommon.display_debug1('Status: %s', connection.status)
        munkicommon.display_debug1('Headers: %s', connection.headers)
    if connection.redirection != []:
        munkicommon.display_debug1('Redirection: %s', connection.redirection)

    temp_download_exists = os.path.isfile(tempdownloadpath)
    connection.headers['http_result_code'] = str(connection.status)
    description = NSHTTPURLResponse.localizedStringForStatusCode_(