]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Use os_type instead of vm_type. Add os_version
authorSandon Van Ness <sandon@inktank.com>
Tue, 23 Jul 2013 22:50:50 +0000 (15:50 -0700)
committerSandon Van Ness <sandon@inktank.com>
Tue, 23 Jul 2013 22:50:50 +0000 (15:50 -0700)
Use os_type instead of vm_type for more generic naming
for when we start re-imaging bare metal. Also added a
os_version dictionary for default versions of distros
that we want over-riding what downburst defaults are.

Signed-off-by: Sandon Van Ness <sandon@inktank.com>
teuthology/lock.py

index 5401596ae8a4570c16d05cf12f6f542e22e6e4da..964f25400dcb8620f6f0c5a1ca2c7cdb09015e0b 100644 (file)
@@ -538,9 +538,21 @@ def create_if_vm(ctx, machine_name):
     if not phys_host:
         return False
     try:
-        vm_type = ctx.vm_type
-    except AttributeError:
-        vm_type = 'ubuntu'
+        os_type = ctx.config['os_type']
+    except KeyError:
+        try:
+            os_type = ctx.os_type
+        except AttributeError:
+            os_type = 'ubuntu'
+    os_version = dict(
+        ubuntu="12.04",
+        fedora="18",
+        centos="6.4",
+        opensuse="12.2",
+        sles="11-sp2",
+        rhel="6.3",
+        debian='6.0'
+        )
     createMe = decanonicalize_hostname(machine_name)
     with tempfile.NamedTemporaryFile() as tmp:
         try:
@@ -548,13 +560,15 @@ def create_if_vm(ctx, machine_name):
         except KeyError:
             lcnfg = {}
 
+        distro = lcnfg.get('distro', os_type.lower())
         file_info = {}
         file_info['disk-size'] = lcnfg.get('disk-size', '30G')
         file_info['ram'] = lcnfg.get('ram', '1.9G')
         file_info['cpus'] = lcnfg.get('cpus', 1)
         file_info['networks'] = lcnfg.get('networks',
                 [{'source' : 'front', 'mac' : status_info['mac']}])
-        file_info['distro'] = lcnfg.get('distro', vm_type.lower())
+        file_info['distro'] = distro
+        file_info['distroversion'] = os_version[distro]
         file_info['additional-disks'] = lcnfg.get(
                 'additional-disks', 3)
         file_info['additional-disks-size'] = lcnfg.get(