[Qa-jenkins-scm] [jenkins.debian.net] 02/03: reproducible: scheduler: bunch of noop (mostly whitespace) changes to follow better pep8

Holger Levsen holger at moszumanska.debian.org
Sat Sep 12 14:36:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit eb6591ab06a5a635573e841ad4ec1d72259c1240
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sat Sep 12 11:30:40 2015 +0000

    reproducible: scheduler: bunch of noop (mostly whitespace) changes to follow better pep8
---
 bin/reproducible_scheduler.py | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py
index beccf71..2d0e670 100755
--- a/bin/reproducible_scheduler.py
+++ b/bin/reproducible_scheduler.py
@@ -80,6 +80,7 @@ LIMITS = {
 
 MAXIMUM = {'amd64': 750, 'armhf': 250}
 
+
 class Limit:
     def __init__(self, arch, queue):
         self.arch = arch
@@ -206,14 +207,14 @@ def update_sources_db(suite, arch, sources):
         pkgs_to_rm.append((pkg, suite, arch))
     log.debug('removed packages ID: ' + str([str(x[0]) for x in rmed_pkgs_id]))
     log.debug('removed packages: ' + str(pkgs_to_rm))
-    cursor.executemany('DELETE FROM sources ' +
+    cursor.executemany('DELETE FROM sources '
                        'WHERE id=?', rmed_pkgs_id)
-    cursor.executemany('DELETE FROM results ' +
+    cursor.executemany('DELETE FROM results '
                        'WHERE package_id=?', rmed_pkgs_id)
-    cursor.executemany('DELETE FROM schedule ' +
+    cursor.executemany('DELETE FROM schedule '
                        'WHERE package_id=?', rmed_pkgs_id)
-    cursor.executemany('INSERT INTO removed_packages '  +
-                       '(name, suite, architecture) ' +
+    cursor.executemany('INSERT INTO removed_packages '
+                       '(name, suite, architecture) '
                        'VALUES (?, ?, ?)', pkgs_to_rm)
     conn_db.commit()
     # finally check whether the db has the correct number of packages
@@ -439,17 +440,17 @@ def scheduler(arch):
         for suite in SUITES:
             empty_pkgs[suite] = []
         untested, msg_untested = empty_pkgs, ''
-        new, msg_new  = schedule_new_versions(arch, total)
-        old_ftbfs, msg_old_ftbfs  = empty_pkgs, ''
-        old, msg_old  = empty_pkgs, ''
+        new, msg_new = schedule_new_versions(arch, total)
+        old_ftbfs, msg_old_ftbfs = empty_pkgs, ''
+        old, msg_old = empty_pkgs, ''
     else:
         log.info(str(total) + ' packages already scheduled' +
                  ', scheduling some more...')
         log.info('==============================================================')
         untested, msg_untested = schedule_untested_packages(arch, total)
-        new, msg_new  = schedule_new_versions(arch, total+len(untested))
-        old_ftbfs, msg_old_ftbfs  = schedule_old_ftbfs_versions(arch, total+len(untested)+len(new))
-        old, msg_old  = schedule_old_versions(arch, total+len(untested)+len(new)+len(old_ftbfs))
+        new, msg_new = schedule_new_versions(arch, total+len(untested))
+        old_ftbfs, msg_old_ftbfs = schedule_old_ftbfs_versions(arch, total+len(untested)+len(new))
+        old, msg_old = schedule_old_versions(arch, total+len(untested)+len(new)+len(old_ftbfs))
 
     now_queued_here = {}
     # make sure to schedule packages in unstable first
@@ -459,12 +460,12 @@ def scheduler(arch):
         if suite not in priotized_suite_order:
             priotized_suite_order.append(suite)
     for suite in priotized_suite_order:
-        query = 'SELECT count(*) ' + \
-                'FROM schedule AS p JOIN sources AS s ON p.package_id=s.id ' + \
+        query = 'SELECT count(*) ' \
+                'FROM schedule AS p JOIN sources AS s ON p.package_id=s.id ' \
                 'WHERE s.suite="{suite}" AND s.architecture="{arch}"'
-        query=query.format(suite=suite, arch=arch)
+        query = query.format(suite=suite, arch=arch)
         now_queued_here[suite] = int(query_db(query)[0][0]) + \
-                        len(untested[suite]+new[suite]+old[suite])
+            len(untested[suite]+new[suite]+old[suite])
         # schedule packages differently in the queue...
         to_be_scheduled = queue_packages({}, untested[suite], datetime.now())
         assert(isinstance(to_be_scheduled, dict))
@@ -522,6 +523,6 @@ if __name__ == '__main__':
         if overall > (MAXIMUM[arch]*2):
             log.info('%s packages already scheduled, nothing to do.', overall)
             continue
-        log.info('%s packages already scheduled, probably scheduling some more...',
-                 overall)
+        log.info('%s packages already scheduled, probably scheduling some '
+                 'more...', overall)
         scheduler(arch)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list