Lines Matching +full:update +full:- +full:commit +full:- +full:hash
3 # Use of this source code is governed by a BSD-style license that can be
104 If they do not exist, they un-prefixed settings will be used.
135 # Using fallback to non-global in order to work without configuration
136 # overhead on non-shard instances.
152 # update the vm's database with test results. Specifying
199 This will re-connect to the database, so it is NOT safe
219 elapsed_time = stop_time - start_time
244 """Private method for function commit to call for retry.
246 return self.con.commit()
249 def commit(self): member in db_sql
250 """Commit the sql transaction."""
343 # create a re-runable function for executing the query
353 # run the query, re-trying after operational errors
372 # create a -re-runable function for executing the query
377 # run the query, re-trying after operational errors
384 def _exec_sql_with_commit(self, sql, values, commit): argument
386 # re-run the query until it succeeds
389 self.con.commit()
394 if commit:
395 self.con.commit()
398 def insert(self, table, data, commit=None): argument
407 @param commit: If commit the transaction .
417 self._exec_sql_with_commit(cmd, values, commit)
420 def delete(self, table, where, commit = None): argument
425 @param commit: If commit the transaction .
428 if commit is None:
429 commit = self.autocommit
435 self._exec_sql_with_commit(sql, values, commit)
438 def update(self, table, data, where, commit = None): argument
440 'update table set data values (%s ... %s) where ...'
448 @param commit: If commit the transaction .
450 if commit is None:
451 commit = self.autocommit
452 cmd = 'update %s ' % table
464 self._exec_sql_with_commit(cmd, values, commit)
467 def delete_job(self, tag, commit = None): argument
471 @param commit: If commit the transaction .
486 def insert_job(self, tag, job, commit=None): argument
491 @param commit: If commit the transaction .
494 data.update({
499 self.update(
500 'tko_jobs', data, {'job_idx': job.job_idx}, commit=commit)
502 self.insert('tko_jobs', data, commit=commit)
523 def insert_or_update_task_reference(self, job, reference_type, commit=None): argument
530 @param commit: Whether to commit this transaction.
548 self.update('tko_task_references',
551 commit=commit)
554 self.insert('tko_task_references', data, commit=commit)
558 def update_job_keyvals(self, job, commit=None): argument
562 @param commit: If commit the transaction .
570 self.update('tko_job_keyvals', data, where=where, commit=commit)
572 self.insert('tko_job_keyvals', data, commit=commit)
575 def insert_test(self, job, test, commit = None): argument
580 @param commit: If commit the transaction .
582 kver = self.insert_kernel(test.kernel, commit=commit)
592 self.update('tko_tests', data,
593 {'test_idx': test_idx}, commit=commit)
601 self.insert('tko_tests', data, commit=commit)
611 commit=commit)
619 commit=commit)
627 self.insert('tko_test_attributes', data, commit=commit)
635 self.insert('tko_test_labels_tests', data, commit=commit)
667 def insert_or_update_machine(self, job, commit=None): argument
673 @param commit: Whether to commit the database transaction.
677 job.machine_idx = self._insert_machine(job, commit=commit)
679 # Only try to update tko_machines record if machine is set. This
681 self._update_machine_information(job, commit=commit)
701 def _insert_machine(self, job, commit = None): argument
705 @param commit: If commit the transaction .
708 self.insert('tko_machines', machine_info, commit=commit)
712 def _update_machine_information(self, job, commit = None): argument
716 @param commit: If commit the transaction .
719 self.update('tko_machines', machine_info,
721 commit=commit)
750 def insert_kernel(self, kernel, commit = None): argument
754 @param commit: If commit the transaction .
760 # If this kernel has any significant patches, append their hash
765 match = re.match(r'.*(-mm[0-9]+|-git[0-9]+)\.(bz2|gz)$',
774 commit=commit)
779 self.update('tko_kernels',
784 self.insert_patch(kver, patch, commit=commit)
788 def insert_patch(self, kver, patch, commit = None): argument
793 @param commit: If commit the transaction .
801 'hash':patch.hash},
802 commit=commit)