summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2016-01-24 21:21:41 +0100
committerChris Schlaeger <chris@linux.com>2016-01-24 21:21:41 +0100
commit8f442ca7f4faef29348ac813401497477cf5af56 (patch)
tree1e9c4eb3559f96a0937044d0c074801a1dd014f0 /lib
parentc452b3d724bb62194326e92d8819902a59d758e0 (diff)
downloadpostrunner-8f442ca7f4faef29348ac813401497477cf5af56.zip
FIX: Move DB check to after directories have been set
Diffstat (limited to 'lib')
-rw-r--r--lib/postrunner/Main.rb6
1 files 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