Skip to content

Commit

Permalink
Ensure dbver is assigned and has a value
Browse files Browse the repository at this point in the history
Addresses issue #85
  • Loading branch information
Feike Steenbergen authored and alexeyklyukin committed Jun 22, 2017
1 parent fd37d8c commit a500a37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pg_view/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a500a37

Please sign in to comment.