Fix cmedb issue
parent
b1d188887b
commit
c47c77ce2e
|
@ -168,10 +168,11 @@ class database:
|
|||
cur.execute("INSERT INTO computers (ip, hostname, domain, os, dc) VALUES (?,?,?,?,?)", [ip, hostname, domain, os, dc])
|
||||
else:
|
||||
for host in results:
|
||||
if (hostname != host[2]) or (domain != host[3]) or (os != host[4]) or (smbv1 != host[6]) or (signing != host[7]):
|
||||
try:
|
||||
try:
|
||||
if (hostname != host[2]) or (domain != host[3]) or (os != host[4]) or (smbv1 != host[6]) or (signing != host[7]):
|
||||
cur.execute("UPDATE computers SET hostname=?, domain=?, os=?, smbv1=?, signing=? WHERE id=?", [hostname, domain, os, smbv1, signing, host[0]])
|
||||
except:
|
||||
except:
|
||||
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]])
|
||||
if dc != None and (dc != host[5]):
|
||||
cur.execute("UPDATE computers SET dc=? WHERE id=?", [dc, host[0]])
|
||||
|
|
Loading…
Reference in New Issue