Update database.py
parent
998b6a4f36
commit
19523a75b5
|
@ -161,11 +161,11 @@ class database:
|
|||
results = cur.fetchall()
|
||||
|
||||
if not len(results):
|
||||
cur.execute("INSERT INTO computers (ip, hostname, domain, os, dc) VALUES (?,?,?,?,?)", [ip, hostname, domain, os, dc])
|
||||
cur.execute("INSERT INTO computers (ip, hostname, domain, os, dc, smbv1, signing) VALUES (?,?,?,?,?,?,?)", [ip, hostname, domain, os, dc, smbv1, signing])
|
||||
else:
|
||||
for host in results:
|
||||
if (hostname != host[2]) or (domain != host[3]) or (os != host[4]):
|
||||
cur.execute("UPDATE computers SET hostname=?, domain=?, os=? WHERE id=?", [hostname, domain, os, host[0]])
|
||||
cur.execute("UPDATE computers SET hostname=?, domain=?, os=?, smbv1, signing WHERE id=?", [hostname, domain, os, smbv1, signing, host[0]])
|
||||
if dc != None and (dc != host[5]):
|
||||
cur.execute("UPDATE computers SET dc=? WHERE id=?", [dc, host[0]])
|
||||
|
||||
|
|
Loading…
Reference in New Issue