diff options
author | Chris Schlaeger <chris@linux.com> | 2016-01-24 21:21:41 +0100 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2016-01-24 21:21:41 +0100 |
commit | 8f442ca7f4faef29348ac813401497477cf5af56 (patch) | |
tree | 1e9c4eb3559f96a0937044d0c074801a1dd014f0 /lib | |
parent | c452b3d724bb62194326e92d8819902a59d758e0 (diff) | |
download | postrunner-8f442ca7f4faef29348ac813401497477cf5af56.zip |
FIX: Move DB check to after directories have been set
Diffstat (limited to 'lib')
-rw-r--r-- | lib/postrunner/Main.rb | 6 |
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 |