From 8f442ca7f4faef29348ac813401497477cf5af56 Mon Sep 17 00:00:00 2001 From: Chris Schlaeger Date: Sun, 24 Jan 2016 21:21:41 +0100 Subject: FIX: Move DB check to after directories have been set --- lib/postrunner/Main.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/postrunner/Main.rb b/lib/postrunner/Main.rb index f53ba16..8f94eeb 100644 --- a/lib/postrunner/Main.rb +++ b/lib/postrunner/Main.rb @@ -42,9 +42,6 @@ module PostRunner create_directory(@db_dir, 'PostRunner data') @db = PEROBS::Store.new(File.join(@db_dir, 'database')) - if (errors = @db.check) != 0 - Log.fatal "Postrunner database is corrupted: #{errors} errors found" - end # Create a hash to store configuration data in the store unless it # exists already. cfg = (@db['config'] ||= @db.new(PEROBS::Hash)) @@ -57,6 +54,9 @@ module PostRunner cfg['data_dir'] = @db_dir setup_directories + if (errors = @db.check) != 0 + Log.fatal "Postrunner database is corrupted: #{errors} errors found" + end execute_command(args) @db.sync -- cgit v1.2.3