pvl.verkko-dhcp: use CREATE IF NOT EXISTS for --create
authorTero Marttila <terom@paivola.fi>
Wed, 24 Oct 2012 21:27:51 +0300
changeset 33 768983d2e71d
parent 32 12816e361b2d
child 35 4a76d20f205f
pvl.verkko-dhcp: use CREATE IF NOT EXISTS for --create
bin/pvl.verkko-dhcp
--- a/bin/pvl.verkko-dhcp	Wed Oct 24 21:03:43 2012 +0300
+++ b/bin/pvl.verkko-dhcp	Wed Oct 24 21:27:51 2012 +0300
@@ -94,7 +94,7 @@
         """
 
         log.info("Creating database tables: dhcp_hosts")
-        db.dhcp_hosts.create(self.db.engine)
+        db.dhcp_hosts.create(self.db.engine, checkfirst=True)
 
     def insert (self, attrs) :
         """
@@ -201,7 +201,7 @@
         """
 
         log.info("Creating database tables: dhcp_leases")
-        db.dhcp_leases.create(self.db.engine)
+        db.dhcp_leases.create(self.db.engine, checkfirst=True)
 
     def update (self, lease) :
         """