rename set_record to add_record
This commit is contained in:
parent
6de0700ac8
commit
116bf7adbc
2 changed files with 16 additions and 16 deletions
|
|
@ -8353,7 +8353,7 @@ class BulkInsertProcessor(object):
|
|||
"""Do bulk inserts - it has some limitations compared to
|
||||
InsertProcessor (no rawset, dup_check).
|
||||
|
||||
set() is replaced with set_record() to avoid confusion
|
||||
set() is replaced with add_record() to avoid confusion
|
||||
|
||||
table - name of the table
|
||||
data - list of dict per record
|
||||
|
|
@ -8405,10 +8405,10 @@ class BulkInsertProcessor(object):
|
|||
def __repr__(self):
|
||||
return "<BulkInsertProcessor: %r>" % vars(self)
|
||||
|
||||
def set_record(self, **kwargs):
|
||||
def add_record(self, **kwargs):
|
||||
"""Set whole record via keyword args"""
|
||||
if not kwargs:
|
||||
raise koji.GenericError("Missing values in BulkInsert.set_record")
|
||||
raise koji.GenericError("Missing values in BulkInsert.add_record")
|
||||
self.data.append(kwargs)
|
||||
self.columns |= set(kwargs.keys())
|
||||
|
||||
|
|
@ -9513,7 +9513,7 @@ def importImageInternal(task_id, build_id, imgdata):
|
|||
continue
|
||||
logger.info('associating installed rpms with %s', archive['id'])
|
||||
for rpm_id in rpm_ids:
|
||||
insert.set_record(archive_id=archive['id'], rpm_id=rpm_id)
|
||||
insert.add_record(archive_id=archive['id'], rpm_id=rpm_id)
|
||||
if insert.data:
|
||||
insert.execute()
|
||||
|
||||
|
|
@ -12514,7 +12514,7 @@ class BuildRoot(object):
|
|||
if rpm_ids:
|
||||
insert = BulkInsertProcessor(table='buildroot_listing')
|
||||
for rpm_id in rpm_ids:
|
||||
insert.set_record(buildroot_id=self.id, rpm_id=rpm_id, is_update=update)
|
||||
insert.add_record(buildroot_id=self.id, rpm_id=rpm_id, is_update=update)
|
||||
insert.execute()
|
||||
|
||||
def setList(self, rpmlist):
|
||||
|
|
@ -12572,7 +12572,7 @@ class BuildRoot(object):
|
|||
if new_archives:
|
||||
insert = BulkInsertProcessor('buildroot_archives')
|
||||
for archive_id in sorted(new_archives):
|
||||
insert.set_record(buildroot_id=self.id,
|
||||
insert.add_record(buildroot_id=self.id,
|
||||
project_dep=project,
|
||||
archive_id=archive_id)
|
||||
insert.execute()
|
||||
|
|
@ -12585,7 +12585,7 @@ class BuildRoot(object):
|
|||
|
||||
insert = BulkInsertProcessor('buildroot_tools_info')
|
||||
for tool in tools:
|
||||
insert.set_record(buildroot_id=self.id, tool=tool['name'], version=tool['version'])
|
||||
insert.add_record(buildroot_id=self.id, tool=tool['name'], version=tool['version'])
|
||||
insert.execute()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue