forked from adamm/git-importer
Add batch import
This commit is contained in:
@@ -10,7 +10,8 @@ from lib.obs import OBS
|
||||
from lib.obs_revision import OBSRevision
|
||||
from lib.proxy_sha256 import ProxySHA256, md5, sha256
|
||||
from lib.request import Request
|
||||
from lib.users import Users
|
||||
import xml.etree.ElementTree as ET
|
||||
from lib.users import User
|
||||
|
||||
|
||||
def _files_hash(hash_alg, dirpath):
|
||||
@@ -159,6 +160,15 @@ class Importer:
|
||||
(lproject, lpackage) = row
|
||||
self.update_db_package(db, lproject, lpackage)
|
||||
|
||||
missing_users = User.get_batch(db)
|
||||
print(missing_users)
|
||||
for userid in missing_users:
|
||||
missing_user = self.obs.user(userid)
|
||||
if missing_user is not None:
|
||||
missing_user.import_into_db(db)
|
||||
else:
|
||||
logging.info("No missing users")
|
||||
|
||||
for rev in DBRevision.all_revisions(db, project, self.package):
|
||||
# TODO move into SELECT
|
||||
if rev.broken or rev.expanded_srcmd5:
|
||||
@@ -174,9 +184,9 @@ class Importer:
|
||||
else:
|
||||
rev.set_broken(db)
|
||||
|
||||
fake_accounts = ["unknown","buildservice-autocommit", "autobuild", "_service"]
|
||||
if Users.user_lookup(db, rev.userid) is None and rev.userid not in fake_accounts:
|
||||
self.obs.users(rev.userid).import_into_db(db)
|
||||
# fake_accounts = ["unknown","buildservice-autocommit", "autobuild", "_service"]
|
||||
# if User.user_lookup(db, rev.userid) is None and rev.userid not in fake_accounts:
|
||||
# self.obs.users(rev.userid).import_into_db(db)
|
||||
|
||||
for number in DBRevision.requests_to_fetch(db, project, self.package):
|
||||
self.obs.request(number).import_into_db(db)
|
||||
|
||||
Reference in New Issue
Block a user