]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Allow short names to teuthology-lock (e.g. "plana14")
authorDan Mick <dan.mick@inktank.com>
Tue, 5 Jun 2012 00:41:57 +0000 (17:41 -0700)
committerDan Mick <dan.mick@inktank.com>
Tue, 5 Jun 2012 00:50:07 +0000 (17:50 -0700)
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
teuthology/lock.py

index 0a6fe5a51bde68ca2d9550e427c24783781eb694..94fb7b0f93715367a19aeea982285585972ccab0 100644 (file)
@@ -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: