Skip to content
Snippets Groups Projects
Commit e9d7be27 authored by Jan Mach's avatar Jan Mach
Browse files

Fix: Fixed minor bug and improved coding style.

(Redmine issue: #3443)
parent 32e3d3cb
No related branches found
No related tags found
No related merge requests found
......@@ -87,10 +87,7 @@ __credits__ = "Pavel Kácha <pavel.kacha@cesnet.cz>, Andrea Kropáčová <andrea
import os
import sys
import time
import datetime
import traceback
#
# Custom libraries
......@@ -133,7 +130,7 @@ class MentatPrecacheScript(mentat.script.fetcher.FetcherScript):
super().__init__(
description = 'mentat-precache.py - Mentat system database pre-caching script',
description = 'mentat-precache.py - Mentat database pre-caching script',
#
# Configure required script paths.
......@@ -230,7 +227,7 @@ class MentatPrecacheScript(mentat.script.fetcher.FetcherScript):
can be then used for various use cases like generating value selection
widgets for user interface etc.
"""
result = {'messages': {'info': [], 'warning': {}}, 'itemsets': {}}
result = {'messages': {'info': [], 'warning': []}, 'itemsets': {}}
for iset in self.c(self.CONFIG_ITEMSETS):
......@@ -264,7 +261,8 @@ class MentatPrecacheScript(mentat.script.fetcher.FetcherScript):
self.logger.info("Status of cache directory '%s'", self.c(self.CONFIG_CACHE_DIR))
for cache in sorted(result.keys()):
self.logger.info("Cache '%s', %d item(s), age: %s, modified on %s",
self.logger.info(
"Cache '%s', %d item(s), age: %s, modified on %s",
result[cache]['file'],
len(result[cache]['data']),
str(datetime.datetime.utcnow() - result[cache]['mtime']),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment