return success
-def list_locks(ctx):
+def list_locks():
success, content, _ = ls.send_request('GET', config.lock_server)
if success:
return json.loads(content)
log.error("Lockserver doesn't know about machine: %s" %
machine)
else:
- statuses = list_locks(ctx)
+ statuses = list_locks()
vmachines = []
for vmachine in statuses:
statuses = [ls.get_status(ctx, machine)
for machine in machines]
else:
- statuses = list_locks(ctx)
+ statuses = list_locks()
if statuses:
if ctx.machine_type:
statuses = [status for status in statuses
def keyscan_check(ctx, machines):
- locks = list_locks(ctx)
+ locks = list_locks()
current_locks = {}
for lock in locks:
current_locks[lock['name']] = lock
def do_summary(ctx):
lockd = collections.defaultdict(lambda: [0, 0, 'unknown'])
- for l in list_locks(ctx):
+ for l in list_locks():
if ctx.machine_type and l['type'] != ctx.machine_type:
continue
who = l['locked_by'] if l['locked'] == 1 else '(free)', l['type']
targets = dict(ctx.config['targets'])
if ctx.name:
log.info('Checking targets against current locks')
- locks = list_locks(ctx)
+ locks = list_locks()
# Remove targets who's description doesn't match archive name.
for lock in locks:
for target in targets:
y = yaml.safe_load(file(yamlfile))
machine_type = y.get('machine_type')
if machine_type:
- fakectx = []
- locks = lock.list_locks(fakectx)
+ locks = lock.list_locks()
for machine in locks:
if machine['type'] == machine_type:
arch = machine['arch']
while True:
# make sure there are enough machines up
- machines = lock.list_locks(ctx)
+ machines = lock.list_locks()
if machines is None:
if ctx.block:
log.warn('error listing machines, trying again')