Bugzilla 629272 explains that a loaned system can still be grabbed by
other users even though the loanee should have exclusive access while
the loan is in effect. I thought I had fixed this before but obviously
didn't. Looking at my previous code I removed the system from the list
of possible systems but were too late for that now, we've already made
our decision about which system to use. So the proper fix is to make
sure we don't execute the rest of the "I have a system available" code.
Simply added an elif.
commit 7f33ab29e7eac9ff60c1dd919a70844527be92ea
Author: Bill Peck <bpeck(a)redhat.com>
Date: Wed Sep 1 11:15:47 2010 -0400
bz629272 - fix logic to prevent us from using systems that we no
longer have access to.
diff --git a/Server/bkr/server/tools/beakerd.py
b/Server/bkr/server/tools/beakerd.py
index b3ce8a3..2e4e1c2 100755
--- a/Server/bkr/server/tools/beakerd.py
+++ b/Server/bkr/server/tools/beakerd.py
@@ -270,21 +270,21 @@ def queued_recipes(*args):
log.debug("System : %s is available for Recipe %s" %
(system, recipe.id))
# Check to see if user still has proper permissions to
use system
# Remember the mapping of available systems could have
happend hours or even
# days ago and groups or loans could have been put in
place since.
if not System.free(user).filter(System.fqdn ==
system).first():
log.debug("System : %s recipe: %s no longer has
access. removing" % (system,
recipe.id)
recipe.systems.remove(system)
# Atomic operation to put recipe in Scheduled state
- if session.connection(Recipe).execute(recipe_table.update(
+ elif
session.connection(Recipe).execute(recipe_table.update(
and_(recipe_table.c.id==recipe.id,
recipe_table.c.status_id==TaskStatus.by_name(u'Queued').id)),
status_id=TaskStatus.by_name(u'Scheduled').id).rowcount == 1:
recipe.createRepo()
Show replies by date