To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit a0c24d6a authored by Reto Da Forno's avatar Reto Da Forno

minor fixes

parent 8b42c35d
......@@ -373,7 +373,7 @@ DROP TABLE IF EXISTS `tbl_serv_tg_adapt_list`;
CREATE TABLE `tbl_serv_tg_adapt_list` (
`serv_tg_adapt_list_key` int(10) unsigned NOT NULL AUTO_INCREMENT,
`tg_adapt_types_fk` int(10) unsigned NOT NULL,
`serialid` varchar(15) COLLATE utf8_bin NOT NULL,
`serialid` varchar(15) COLLATE utf8_bin UNIQUE NOT NULL,
`adapterid` int(11) DEFAULT NULL COMMENT 'ID as labelled on adapter',
`last_changed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`serv_tg_adapt_list_key`),
......
......@@ -5,7 +5,7 @@ __copyright__ = "Copyright 2010, ETH Zurich, Switzerland"
__license__ = "GPL"
import sys, os, getopt, errno, threading, shutil, time, datetime, subprocess, tempfile, queue, re, logging, traceback, __main__, types, hashlib
import sys, os, getopt, errno, threading, shutil, time, datetime, subprocess, tempfile, queue, re, logging, traceback, __main__, types, hashlib, MySQLdb
from lxml import etree
from MySQLdb.constants import ER as MySQLErrors
# Import local libraries
......
......@@ -166,7 +166,7 @@ def convert_gpio_monitor(obsdata, observer_id, node_id):
return "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, pindict[obsdata[0]][0], obsdata[1])
def convert_serial(obsdata, observer_id, node_id):
return "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, serialdict[obsdata[0]], obsdata[1].decode('utf-8'))
return "%s,%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, serialdict[obsdata[0]], obsdata[1])
def convert_error_log(obsdata, observer_id, node_id):
return "%s,%s,%s,%s\n" %(obsdata[2], observer_id, node_id, obsdata[1])
......@@ -1273,7 +1273,7 @@ def main(argv):
if os.path.exists(config.get('fetcher', 'obsfile_debug_dir')):
for d in [fn for fn in os.listdir(config.get('fetcher', 'obsfile_debug_dir')) if os.stat("%s/%s" % (config.get('fetcher', 'obsfile_debug_dir'), fn)).st_mtime < int(time.time()) - int(config.get('fetcher', 'obsfile_debug_dir_max_age_days')) * 24 * 3600]:
shutil.rmtree("%s/%s" % (config.get('fetcher', 'obsfile_debug_dir'),d))
if len(errors) > 1:
if len(errors) > 0:
msg = ""
for error in errors:
msg += error
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment