grr/server/grr_response_server/databases/mysql_clients.py
def WriteClientCrashInfo(self, client_id, crash_info, cursor=None):
    """Writes a new client crash record."""
    cid = mysql_utils.ClientIDToInt(client_id)
    now = mysql_utils.RDFDatetimeToMysqlString(rdfvalue.RDFDatetime.Now())
    try:
      cursor.execute(
          "INSERT INTO client_crash_history (client_id, timestamp, crash_info) "
          "VALUES (%s, %s, %s)",
          [cid, now, crash_info.SerializeToString()])
      cursor.execute(
          "UPDATE clients SET last_crash_timestamp = %s WHERE client_id=%s",
          [now, cid])

    except MySQLdb.IntegrityError as e:
      raise db.UnknownClientError(client_id, cause=e)
Writes a new client crash record.
Writes a new client crash record.
Writes a new client crash record .
def WriteClientCrashInfo(self, client_id, crash_info, cursor=None):
    cid = mysql_utils.ClientIDToInt(client_id)
    now = mysql_utils.RDFDatetimeToMysqlString(rdfvalue.RDFDatetime.Now())
    try:
      cursor.execute(
          "INSERT INTO client_crash_history (client_id, timestamp, crash_info) "
          "VALUES (%s, %s, %s)",
          [cid, now, crash_info.SerializeToString()])
      cursor.execute(
          "UPDATE clients SET last_crash_timestamp = %s WHERE client_id=%s",
          [now, cid])
    except MySQLdb.IntegrityError as e:
      raise db.UnknownClientError(client_id, cause=e)
def WriteClientCrashInfo ( self , client_id , crash_info , cursor = None ) : cid = mysql_utils . ClientIDToInt ( client_id ) now = mysql_utils . RDFDatetimeToMysqlString ( rdfvalue . RDFDatetime . Now ( ) ) try : cursor . execute ( "INSERT INTO client_crash_history (client_id, timestamp, crash_info) " "VALUES (%s, %s, %s)" , [ cid , now , crash_info . SerializeToString ( ) ] ) cursor . execute ( "UPDATE clients SET last_crash_timestamp = %s WHERE client_id=%s" , [ now , cid ] ) except MySQLdb . IntegrityError as e : raise db . UnknownClientError ( client_id , cause = e )
Writes a new client crash record.
Writes a new client crash record .
"""Writes a new client crash record."""
self
client_id
crash_info
cursor