]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Remove needless arg from list_locks() 138/head
authorZack Cerza <zack@cerza.org>
Mon, 14 Oct 2013 20:03:08 +0000 (15:03 -0500)
committerZack Cerza <zack@cerza.org>
Wed, 16 Oct 2013 21:20:24 +0000 (16:20 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/lock.py
teuthology/nuke.py
teuthology/suite.py
teuthology/task/internal.py

index dc69e845d8e125bd00b6477e922f9da2a4396712..de39f8c63a217eb91e088e2dcc6f9ad57b1d127e 100644 (file)
@@ -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']
index f45debe9447473b9a5545bdb1a583840a26adf5b..166f390df9b6f0458e4f8bf5395a98f921bf65cc 100644 (file)
@@ -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:
index 026a73ce716589c135e9935425768e28ea6e512c..d253e687195bb9ae5208310c488fe20438fd4c57 100644 (file)
@@ -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']
index 4ef4923e156653841ce288063281c2a1633bcf55..fa9b22ac8eea7bb5a9fa154c9b9ce4fddc807f7f 100644 (file)
@@ -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')