From: Dan Mick Date: Tue, 5 Jun 2012 00:41:57 +0000 (-0700) Subject: Allow short names to teuthology-lock (e.g. "plana14") X-Git-Tag: 1.1.0~2554 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=044697d17878604b41acd1b24aaddfa7b355122a;p=teuthology.git Allow short names to teuthology-lock (e.g. "plana14") Signed-off-by: Dan Mick Reviewed-by: Sam Just --- diff --git a/teuthology/lock.py b/teuthology/lock.py index 0a6fe5a51..94fb7b0f9 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -5,6 +5,7 @@ import logging import subprocess import urllib import yaml +import re from teuthology import misc as teuthology @@ -206,6 +207,12 @@ Lock, unlock, or query lock status of machines. machines = ctx.machines machines_to_update = [] + def canonicalize_hostname(s): + if re.match('ubuntu@.*\.front\.sepia\.ceph\.com', s) is None: + s = 'ubuntu@' + s + '.front.sepia.ceph.com' + return s + machines = map(canonicalize_hostname, machines) + if ctx.targets: try: with file(ctx.targets) as f: