Permalink
Browse files

Fixed a silly oversight that would have broken the caching database o…

…n duplicate keys.
  • Loading branch information...
red.hamsterx
red.hamsterx committed Sep 9, 2013
1 parent 0512dff commit 3d2b1e7820c311019411a5321ba16a5bd0325821
Showing with 3 additions and 3 deletions.
  1. +1 −1 makedebs.sh
  2. +2 −2 staticDHCPd/staticdhcpdlib/databases/generic.py
View
@@ -1,6 +1,6 @@
#Runs both libpydhcpserver and staticDHCPd's Debian scripts
cd libpydhcpserver
/usr/bin/debuild -uc -us
/usr/bin/debuild -uc -us
cd ..
cd staticDHCPd
@@ -267,7 +267,7 @@ def _lookupMAC(self, mac):
def _cacheMAC(self, mac, definition, chained):
(database, cursor) = self._connect()
cursor.execute("INSERT INTO subnets (subnet, serial, lease_time, gateway, subnet_mask, broadcast_address, ntp_servers, domain_name_servers, domain_name) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
cursor.execute("INSERT INTO OR IGNORE subnets (subnet, serial, lease_time, gateway, subnet_mask, broadcast_address, ntp_servers, domain_name_servers, domain_name) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
(
definition.subnet, definition.serial,
definition.lease_time,
@@ -397,4 +397,4 @@ def reinitialise(self):
that the database will provide fresh data, whether that means flushing
a cache or reconnecting to the source.
"""

0 comments on commit 3d2b1e7

Please sign in to comment.