]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
skip specific os_type/os_version request when FOG reimage in place
authorVasu Kulkarni <vasu@redhat.com>
Thu, 15 Feb 2018 21:08:05 +0000 (13:08 -0800)
committerVasu Kulkarni <vasu@redhat.com>
Mon, 17 Dec 2018 23:10:49 +0000 (15:10 -0800)
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
teuthology/lock/ops.py

index e6815d7833da777d48251467f6ee1903c96fb807..fa1b69af0623813f55ad296cf55fb2da3963c17a 100644 (file)
@@ -80,11 +80,19 @@ def lock_many(ctx, num, machine_type, user=None, description=None,
         # Only query for os_type/os_version if non-vps and non-libcloud, since
         # in that case we just create them.
         vm_types = ['vps'] + teuthology.provision.cloud.get_types()
+        # backup os_type/os_version to be restored after machine lock
+        # with FOG we dont need to request specific os_type/os_version
+        if os_type:
+            os_type_bu = os_type
+            os_type = None
+        if os_version:
+            os_version_bu = os_version
+            os_version = None
         if machine_type not in vm_types:
-            if os_type:
-                data['os_type'] = os_type
-            if os_version:
-                data['os_version'] = os_version
+            if os_type_bu:
+                data['os_type'] = os_type_bu
+            if os_version_bu:
+                data['os_version'] = os_version_bu
         if arch:
             data['arch'] = arch
         log.debug("lock_many request: %s", repr(data))
@@ -110,6 +118,11 @@ def lock_many(ctx, num, machine_type, user=None, description=None,
                     ok_machs = keys.do_update_keys(ok_machs.keys())[1]
                 return ok_machs
             else:
+                # restore os_type/os_version after machine lock
+                if os_type_bu:
+                    os_type = os_type_bu
+                if os_version_bu:
+                    os_version = os_version_bu
                 reimaged = dict()
                 console_log_conf = dict(
                     logfile_name='{shortname}_reimage.log',