From: Zack Cerza Date: Mon, 29 Sep 2014 21:00:22 +0000 (-0600) Subject: Query os_type and os_version in lock_many() X-Git-Tag: 1.1.0~1139 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=86e934ef25b70b7fdf86a415de5a8dfe7aea257c;p=teuthology.git Query os_type and os_version in lock_many() Signed-off-by: Zack Cerza --- diff --git a/teuthology/lock.py b/teuthology/lock.py index 159ed331..5f14ebac 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -259,7 +259,7 @@ def main(ctx): machines_to_update.append(machine) elif ctx.num_to_lock: result = lock_many(ctx, ctx.num_to_lock, ctx.machine_type, user, - ctx.desc) + ctx.desc, ctx.os_type, ctx.os_version) if not result: ret = 1 else: @@ -300,7 +300,8 @@ def main(ctx): return ret -def lock_many(ctx, num, machine_type, user=None, description=None): +def lock_many(ctx, num, machine_type, user=None, description=None, + os_type=None, os_version=None): if user is None: user = misc.get_user() @@ -331,6 +332,13 @@ def lock_many(ctx, num, machine_type, user=None, description=None): machine_type=machine_type, description=description, ) + # Only query for os_type/os_version if non-vps, since in that case we + # just create them. + if machine_type != 'vps': + if os_type: + data['os_type'] = os_type + if os_version: + data['os_version'] = os_version log.debug("lock_many request: %s", repr(data)) response = requests.post( uri,