You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
''' Test if the entry already exists in the database '''
88
-
# Check if the entry exists already
89
-
sql="SELECT COUNT(*) FROM "+db_table+" WHERE date = '"+test_datetime.isoformat() +"' AND destination = '"+destination+"' AND source = '"+source_ip+"' AND file_id = "+str(file_id)
''' Insert a test connection to the database, if it not already exists '''
106
-
# Check if the entry exists already
107
-
sql="SELECT COUNT(*) FROM "+db_table+" WHERE date = '"+test_datetime.isoformat() +"' AND destination = '"+destination+"' AND source = '"+source_ip+"' AND file_id = "+str(file_id)
108
-
cur.execute(sql)
109
-
110
-
# If not, then isert it
111
-
ifcur.fetchone()[0] <1:
112
-
print'Found new test performed on the', test_datetime, 'from '+destination+' -> '+source_ip+'.'
print'updating between'+start_datum+' AND '+end_datum
158
129
try:
159
-
sql='UPDATE mlab.glasnost SET locID = M.`locId` FROM mlab.glasnost L , maxmind.'+table+' M WHERE L.`source` BETWEEN M.`startnumip` AND M.`endnumip` AND L.`date` BETWEEN "'+start_datum+'" AND "'+end_datum+'" AND L.`locId` = 0'
130
+
sql='UPDATE mlab.glasnost SET locId = M.`locId` FROM mlab.glasnost L , maxmind.'+table+' M WHERE L.`source` BETWEEN M.`startnumip` AND M.`endnumip` AND L.`date` BETWEEN "'+start_datum+'" AND "'+end_datum+'" AND L.`locId` = 0'
0 commit comments