Commit 733b31a3 authored by Julien Muchembled's avatar Julien Muchembled Committed by Xavier Thompson

proxy: Cleanup

parent 480cfb02
...@@ -731,18 +731,14 @@ def getAllocatedSlaveInstance(slave_reference, requested_computer_id): ...@@ -731,18 +731,14 @@ def getAllocatedSlaveInstance(slave_reference, requested_computer_id):
""" """
Look for existence of instance, if so return the Look for existence of instance, if so return the
corresponding partition dict, else return None corresponding partition dict, else return None
"""
args = []
a = args.append
# XXX: Scope currently depends on instance which requests slave. # XXX: Scope currently depends on instance which requests slave.
# Meaning that two different instances requesting the same slave will # Meaning that two different instances requesting the same slave will
# result in two different allocated slaves. # result in two different allocated slaves.
table = 'slave' """
q = 'SELECT * FROM %s WHERE reference=? and computer_reference=?' return execute_db('slave',
a(slave_reference) 'SELECT * FROM %s WHERE reference is ? AND computer_reference is ?',
a(requested_computer_id) (slave_reference, requested_computer_id), one=True)
# XXX: check there is only one result
return execute_db(table, q, args, one=True)
def getRootPartition(reference): def getRootPartition(reference):
"""Climb the partitions tree up by 'requested_by' link to get the root partition.""" """Climb the partitions tree up by 'requested_by' link to get the root partition."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment