cleanup context managers

This commit is contained in:
Nico Krapp 2022-10-26 13:46:02 +02:00
parent 1656d73340
commit dbeb534108
No known key found for this signature in database
GPG Key ID: AC35CFFF55212BC7

View File

@ -160,26 +160,26 @@ class Importer:
(lproject, lpackage) = row
self.update_db_package(db, lproject, lpackage)
missing_users = User.missing_users(db)
for userid in missing_users:
missing_user = self.obs.user(userid)
if missing_user:
missing_user.import_into_db(db)
missing_users = User.missing_users(db)
for userid in missing_users:
missing_user = self.obs.user(userid)
if missing_user:
missing_user.import_into_db(db)
for rev in DBRevision.all_revisions(db, project, self.package):
# TODO move into SELECT
if rev.broken or rev.expanded_srcmd5:
continue
linked_rev = rev.linked_rev(db)
if linked_rev:
linked_rev = linked_rev.unexpanded_srcmd5
list = self.obs.list(
project, self.package, rev.unexpanded_srcmd5, linked_rev
)
if list:
rev.import_dir_list(db, list)
else:
rev.set_broken(db)
for rev in DBRevision.all_revisions(db, project, self.package):
# TODO move into SELECT
if rev.broken or rev.expanded_srcmd5:
continue
linked_rev = rev.linked_rev(db)
if linked_rev:
linked_rev = linked_rev.unexpanded_srcmd5
list = self.obs.list(
project, self.package, rev.unexpanded_srcmd5, linked_rev
)
if list:
rev.import_dir_list(db, list)
else:
rev.set_broken(db)
for number in DBRevision.requests_to_fetch(db, project, self.package):
self.obs.request(number).import_into_db(db)