From ded5c219fc2cc980316fa5e305a7f1eb4b63d501 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 14 Oct 2013 15:03:08 -0500 Subject: [PATCH] Remove needless arg from list_locks() Signed-off-by: Zack Cerza --- teuthology/lock.py | 10 +++++----- teuthology/nuke.py | 2 +- teuthology/suite.py | 3 +-- teuthology/task/internal.py | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/teuthology/lock.py b/teuthology/lock.py index dc69e845d8e12..de39f8c63a217 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -83,7 +83,7 @@ def unlock_one(ctx, name, user=None): return success -def list_locks(ctx): +def list_locks(): success, content, _ = ls.send_request('GET', config.lock_server) if success: return json.loads(content) @@ -181,7 +181,7 @@ def main(ctx): log.error("Lockserver doesn't know about machine: %s" % machine) else: - statuses = list_locks(ctx) + statuses = list_locks() vmachines = [] for vmachine in statuses: @@ -196,7 +196,7 @@ def main(ctx): 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 @@ -330,7 +330,7 @@ def updatekeys(ctx): def keyscan_check(ctx, machines): - locks = list_locks(ctx) + locks = list_locks() current_locks = {} for lock in locks: current_locks[lock['name']] = lock @@ -375,7 +375,7 @@ def scan_for_locks(ctx, machines): 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'] diff --git a/teuthology/nuke.py b/teuthology/nuke.py index f45debe944747..166f390df9b6f 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -321,7 +321,7 @@ def nuke(ctx, should_unlock, sync_clocks=True, reboot_all=True, noipmi=False): 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: diff --git a/teuthology/suite.py b/teuthology/suite.py index 026a73ce71658..d253e687195bb 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -255,8 +255,7 @@ def get_arch(config): 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'] diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 4ef4923e15665..fa9b22ac8eea7 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -56,7 +56,7 @@ def lock_machines(ctx, config): 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') -- 2.39.5