diff --git a/secop/lib/__init__.py b/secop/lib/__init__.py index ad3df26..8118f24 100644 --- a/secop/lib/__init__.py +++ b/secop/lib/__init__.py @@ -52,9 +52,12 @@ else: # overwrite with env variables SECOP_LOGDIR, SECOP_PIDDIR, SECOP_CONFDIR, if present for dirname in CONFIG: CONFIG[dirname] = environ.get('SECOP_%s' % dirname.upper(), CONFIG[dirname]) + # this is not customizable CONFIG['basedir'] = repodir +# TODO: if ever more general options are need, we should think about a general config file + unset_value = object() diff --git a/secop/server.py b/secop/server.py index d7f8db0..cde2ff8 100644 --- a/secop/server.py +++ b/secop/server.py @@ -275,8 +275,16 @@ class Server: self.log.info('all modules and pollers started') history_path = os.environ.get('FRAPPY_HISTORY') if history_path: - from secop.historywriter import FrappyHistoryWriter # pylint: disable=import-outside-toplevel + from secop_psi.historywriter import FrappyHistoryWriter # pylint: disable=import-outside-toplevel writer = FrappyHistoryWriter(history_path, PREDEFINED_ACCESSIBLES.keys(), self.dispatcher) # treat writer as a connection self.dispatcher.add_connection(writer) writer.init(self.dispatcher.handle_describe(writer, None, None)) + # TODO: if ever somebody wants to implement an other history writer: + # - a general config file /etc/secp/secop.conf or /etc/secop.conf + # might be introduced, which contains the log, pid and cfg directory path and + # the class path implementing the history + # - or we just add here an other if statement: + # history_path = os.environ.get('ALTERNATIVE_HISTORY') + # if history_path: + # from secop_.historywriter import ... etc. diff --git a/secop/historywriter.py b/secop_psi/historywriter.py similarity index 100% rename from secop/historywriter.py rename to secop_psi/historywriter.py