invirt-database-tables: populate types table
authorGreg Price <price@mit.edu>
Sat, 31 Jan 2009 08:49:59 +0000 (03:49 -0500)
committerGreg Price <price@mit.edu>
Sat, 31 Jan 2009 08:49:59 +0000 (03:49 -0500)
svn path=/trunk/packages/invirt-database-server/; revision=2053

debian/changelog
invirt-database-tables

index 0ab2be3..79634c1 100644 (file)
@@ -1,3 +1,9 @@
+invirt-database-server (0.0.10) unstable; urgency=low
+
+  * invirt-database-tables: populate types table
+
+ -- Greg Price <price@mit.edu>  Sat, 31 Jan 2009 03:49:33 -0500
+
 invirt-database-server (0.0.9) unstable; urgency=low
 
   * Add Provides and Conflicts lines to debian/control for
 invirt-database-server (0.0.9) unstable; urgency=low
 
   * Add Provides and Conflicts lines to debian/control for
index 0b37bfc..695b04f 100755 (executable)
@@ -10,10 +10,20 @@ def usage():
 if len(sys.argv) == 1:
     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.connect()
 
 if sys.argv[1] == "create":
-    database.meta.create_all()
+    create()
 elif sys.argv[1] == "drop":
     database.meta.drop_all()
 else:
 elif sys.argv[1] == "drop":
     database.meta.drop_all()
 else: