コード例 #1
0
ファイル: connection.py プロジェクト: thybit/lsr-network
def _nm_profile_volatile_update2_call_back(nm_profile, result, user_data):
    main_loop = user_data
    if main_loop.is_cancelled:
        return

    try:
        success = nm_profile.update2_finish(result)
    except Exception as e:
        main_loop.fail(
            error.LsrNetworkNmError(
                "Connection volatilize aborted on {id}/{uuid}: error={error}".
                format(id=nm_profile.get_id(),
                       uuid=nm_profile.get_uuid(),
                       error=e)))
    if success:
        main_loop.quit()
    else:
        main_loop.fail(
            error.LsrNetworkNmError(
                "Connection volatilize aborted on {id}/{uuid}: error=unknown".
                format(id=nm_profile.get_id(), uuid=nm_profile.get_uuid())))
コード例 #2
0
def _deactivate_fail(main_loop, handler_id, nm_ac, msg):
    if nm_ac:
        nm_ac.handler_disconnect(handler_id)
    logging.error(msg)
    main_loop.fail(error.LsrNetworkNmError(msg))
コード例 #3
0
 def _timeout_call_back(self, _user_data):
     logging.error("Timeout")
     self.fail(error.LsrNetworkNmError("Timeout"))