invirt-database-tables: populate types table
[invirt/packages/invirt-database.git] / invirt-database-tables
index 0b37bfc..695b04f 100755 (executable)
@@ -10,10 +10,20 @@ def usage():
 if len(sys.argv) == 1:
     usage()
 
+def create():
+    database.meta.create_all()
+    session = database.session()
+    session.begin()
+    session.save(database.Type(type_id='linux-hvm', description='HVM',
+                               hvm='t', apic='t', acpi='t', pae='t'))
+    session.save(database.Type(type_id='linux', description='ParaVM',
+                               hvm='f', apic='f', acpi='f', pae='f'))
+    session.commit()
+
 database.connect()
 
 if sys.argv[1] == "create":
-    database.meta.create_all()
+    create()
 elif sys.argv[1] == "drop":
     database.meta.drop_all()
 else: