]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Less dangerous hostname mangling
authorZack Cerza <zack.cerza@inktank.com>
Tue, 26 Aug 2014 16:33:17 +0000 (10:33 -0600)
committerZack Cerza <zack.cerza@inktank.com>
Tue, 26 Aug 2014 16:35:46 +0000 (10:35 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/lock.py
teuthology/task/internal.py

index 226e667dbe036b60e4a90cab61cae8d39472b3e6..d0192efcf7aa4770fc6567125210e217468fb7d2 100644 (file)
@@ -186,8 +186,8 @@ def main(ctx):
             machines_to_update = result.keys()
             if ctx.machine_type == 'vps':
                 shortnames = ' '.join(
-                    [name.split('@')[1].split('.')[0]
-                        for name in result.keys()]
+                    [misc.decanonicalize_hostname(name) for name in
+                     result.keys()]
                 )
                 if len(result) < ctx.num_to_lock:
                     log.error("Locking failed.")
index 87991579db7497cf7462578a741a71067643eb30..bda6df8bbc3f86389a61e94ea540afddfc742379 100644 (file)
@@ -117,8 +117,9 @@ def lock_machines(ctx, config):
                         for guest in vmlist:
                             if guest not in keys_dict.keys():
                                 log.info('recreating: ' + guest)
-                                provision.destroy_if_vm(ctx, 'ubuntu@' + guest)
-                                provision.create_if_vm(ctx, 'ubuntu@' + guest)
+                                full_name = misc.canonicalize_hostname(guest)
+                                provision.destroy_if_vm(ctx, full_name)
+                                provision.create_if_vm(ctx, full_name)
                 if lock.do_update_keys(keys_dict):
                     log.info("Error in virtual machine keys")
                 newscandict = {}