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 1626dc32 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

make logging in debug mode less verbose

parent 8fa1e0ec
......@@ -122,11 +122,11 @@ def main(argv):
rs = cur.fetchall()
for (testid, starttime) in rs:
testid = str(testid)
logger.debug("Found test ID %s to delete." % testid)
logger.info("Found test ID %s to delete." % testid)
# If a test is to be deleted which has not run yet, delete it completely. Otherwise, keep the metadata of the test for statistics:
if (starttime > datetime.datetime.today()):
delete_all = True
logger.debug("Test ID %s did not run yet, thus all data (including the test metadata) will be deleted." % testid)
logger.warning("Test ID %s did not run yet, thus all data (including the test metadata) will be deleted." % testid)
else:
delete_all = False
# Clean through all relevant tables ---
......@@ -140,7 +140,7 @@ def main(argv):
starttime = time.time()
num_deleted_rows = cur.execute(sql%(table, testid))
cn.commit()
logger.debug("Deleted %i rows of data in table %s for test ID %s in %f seconds" % (num_deleted_rows, table, testid, (time.time()-starttime)))
logger.debug("Deleted %i rows of data in table %s for test ID %s in %f seconds." % (num_deleted_rows, table, testid, (time.time()-starttime)))
# Delete cached test results ---
archive_path = "%s/%s%s" % (flocklab.config.get('archiver','archive_dir'), testid, flocklab.config.get('archiver','archive_ext'))
......@@ -151,7 +151,7 @@ def main(argv):
os.remove(path)
else:
shutil.rmtree(path)
logger.debug("Removed path %s for test %s." % (path, testid))
logger.info("Removed path %s for test %s." % (path, testid))
# Delete test itself ---
if delete_all:
......@@ -162,7 +162,7 @@ def main(argv):
starttime = time.time()
num_deleted_rows = cur.execute(sql % (testid))
cn.commit()
logger.debug("Deleted %i rows of data in table tbl_serv_tests for test ID %s in %f seconds" % (num_deleted_rows, testid, (time.time()-starttime)))
logger.debug("Deleted %i rows of data in table tbl_serv_tests for test ID %s in %f seconds." % (num_deleted_rows, testid, (time.time()-starttime)))
else:
# Set test status to deleted but keep metadata ---
flocklab.set_test_status(cur, cn, int(testid), "deleted")
......@@ -176,10 +176,10 @@ def main(argv):
for f in os.listdir(vizdir):
path = os.path.join(vizdir, f)
if os.stat(path).st_mtime < earliest_keeptime:
logger.debug("Removing plots %s..." % path)
logger.info("Removing plots %s..." % path)
os.remove(path)
else:
logger.debug("Directory '%s' does not exist." % vizdir)
logger.warning("Directory '%s' does not exist." % vizdir)
# Get parameters ---
now = time.strftime(flocklab.config.get("database", "timeformat"), time.gmtime())
......
......@@ -235,11 +235,11 @@ class StartTestThread(threading.Thread):
logger.debug("Test start script on observer ID %s succeeded (took %us)." % (self._obsdict_key[self._obskey][1], int(time.time() - starttime)))
# Remove image file and xml on server:
os.remove(self._xmldict_key[self._obskey][0])
logger.debug("Removed XML config %s for observer ID %s" % (self._xmldict_key[self._obskey][0], self._obsdict_key[self._obskey][1]))
#logger.debug("Removed XML config %s for observer ID %s" % (self._xmldict_key[self._obskey][0], self._obsdict_key[self._obskey][1]))
if self._obskey in list(self._imagedict_key.keys()):
for image in self._imagedict_key[self._obskey]:
os.remove(image[0])
logger.debug("Removed target image %s for observer ID %s" % (self._imagedict_key[self._obskey][0], self._obsdict_key[self._obskey][1]))
#logger.debug("Removed target image %s for observer ID %s" % (self._imagedict_key[self._obskey][0], self._obsdict_key[self._obskey][1]))
except:
logger.debug("Exception: %s, %s" % (str(sys.exc_info()[0]), str(sys.exc_info()[1])))
......@@ -881,7 +881,7 @@ def stop_test(testid, cur, cn, obsdict_key, obsdict_id, abort=False):
thread = StopTestThread(obskey, obsdict_key, errors_queue,testid)
thread_list.append((thread, obskey))
thread.start()
logger.debug("Started thread for test stop on observer ID %s" %(str(obsdict_key[obskey][1])))
#logger.debug("Started thread for test stop on observer ID %s" %(str(obsdict_key[obskey][1])))
# Wait for all threads to finish:
for (thread, obskey) in thread_list:
thread.join(timeout=(flocklab.config.getint('tests','cleanuptime') * 0.75))
......
......@@ -618,7 +618,7 @@ class FetchObsThread(threading.Thread):
def run(self):
try:
self._loggerprefix = "(FetchObsThread.%d) "%self._obsid
self._logger.info(self._loggerprefix + "FetchObsThread starting...")
#self._logger.info(self._loggerprefix + "FetchObsThread starting...")
removelast = True
# Let thread run until someone calls terminate() on it:
......@@ -700,8 +700,8 @@ class FetchObsThread(threading.Thread):
self._logger.error(self._loggerprefix + "Could not remove files on observer, result was %d, error: %s" % (rs, err))
else:
self._logger.debug(self._loggerprefix + "No files left to delete on observer.")
else:
self._logger.debug(self._loggerprefix + "No files to download from observer.")
#else:
# self._logger.debug(self._loggerprefix + "No files to download from observer.")
if removelast == False: # this is the last execution of the while loop
cmd = ['ssh' ,'%s'%(self._obsethernet), "rm -rf %s" % self._obstestresfolder]
......
......@@ -91,8 +91,7 @@ def test_startstopabort(testid=None, abort=False, delay=0):
logger.debug("Command executed was: %s"%(str(cmd2)))
rs = errno.EALREADY
else:
if debug:
cmd.append('--debug')
cmd.append('--debug')
p = subprocess.Popen(cmd)
p.wait()
rs = p.returncode
......@@ -235,7 +234,7 @@ def main(argv):
flocklab.send_mail(subject="[FlockLab Scheduler] Missed test %d" % (testid), message=msg, recipients=owner_email)
else:
logger.error("Error %s returned when trying to get test owner information" % str(rs))
logger.debug("Updated test status of %d missed tests to 'failed' and informed users." % nmissed)
logger.warning("Updated test status of %d missed tests to 'failed' and informed users." % nmissed)
else:
logger.debug("No missed tests found.")
rs = errno.ENODATA
......@@ -253,7 +252,7 @@ def main(argv):
testid = int(test[0])
dispatcher_pid = flocklab.get_dispatcher_pid(testid)
if dispatcher_pid != flocklab.FAILED:
logger.debug("Telling dispatcher with pid %d to abort test %d (status: %s)." % (dispatcher_pid, testid, test[1]))
logger.warning("Telling dispatcher with pid %d to abort test %d (status: %s)." % (dispatcher_pid, testid, test[1]))
os.kill(dispatcher_pid, signal.SIGTERM)
# Release Lock ---
......
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