From a500a37bada20d05890baf9337690c60a880b760 Mon Sep 17 00:00:00 2001 From: Feike Steenbergen Date: Thu, 22 Jun 2017 13:35:24 +0200 Subject: [PATCH] Ensure dbver is assigned and has a value Addresses issue #85 --- pg_view/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pg_view/__init__.py b/pg_view/__init__.py index f34f370..cd9eb47 100644 --- a/pg_view/__init__.py +++ b/pg_view/__init__.py @@ -190,6 +190,7 @@ def main(): # now try to read the configuration file config = read_configuration(options.config_file) if options.config_file else None + dbver = None if config: for instance in config: if user_dbname and instance != user_dbname: @@ -250,6 +251,8 @@ def main(): # initialize the disks stat collector process and create an exchange queue q = JoinableQueue(1) work_directories = [cl['wd'] for cl in clusters if 'wd' in cl] + dbver = dbver or clusters[0]['ver'] + collector = DetachedDiskStatCollector(q, work_directories, dbver) collector.start() consumer = DiskCollectorConsumer(q)