routertools/alfred: Recognize MySQL lock as specific exception

This will not change the router status to unknown

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2017-12-08 14:42:50 +01:00
parent b016489cfb
commit a1024baea0
1 changed files with 4 additions and 0 deletions

View File

@ -168,6 +168,10 @@ def import_nodewatcher_xml(mysql, mac, xml):
set_status(mysql,router_id,"unknown")
status = "unknown"
status_comment = "Integer Overflow"
except my.OperationalError as e:
import traceback
print("Warning: Operational error in MySQL when saving %s: %s\n__%s" % (mac, e, traceback.format_exc().replace("\n", "\n__")))
writelog(CONFIG["debug_dir"] + "/fail_readrouter.txt", "{} - {}".format(router_update["hostname"],e))
except Exception as e:
import traceback
print("Warning: Exception occurred when saving %s: %s\n__%s" % (mac, e, traceback.format_exc().replace("\n", "\n__")))