Skip to content

Commit

Permalink
Commit the data directory rather than creating it when the server starts
Browse files Browse the repository at this point in the history
If we are not running a server on worker containers it feels like this
directory won't exist. I don't see why we shouldn't just have it exist
in the source tree.
  • Loading branch information
carbonin committed Jan 22, 2020
1 parent 2730beb commit 5c7dd53
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.ruby-version
.sass-cache/
.tags
/data/
/data/*
/productization
/plugins
/vmdb/
Expand Down
7 changes: 0 additions & 7 deletions app/models/miq_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ def self.destroy_linked_events(server_id)
EventStream.where(:target_id => server_id, :target_type => "MiqServer").destroy_all
end

def self.setup_data_directory
# create root data directory
data_dir = File.join(File.expand_path(Rails.root), "data")
Dir.mkdir(data_dir) unless File.exist?(data_dir)
end

def self.pidfile
@pidfile ||= "#{Rails.root}/tmp/pids/evm.pid"
end
Expand Down Expand Up @@ -176,7 +170,6 @@ def self.start

EvmDatabase.seed_primordial

setup_data_directory
check_migrations_up_to_date
Vmdb::Settings.activate

Expand Down
Empty file added data/.gitkeep
Empty file.

0 comments on commit 5c7dd53

Please sign in to comment.