summaryrefslogtreecommitdiff
path: root/lib/gitlab/setup_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/setup_helper.rb')
-rw-r--r--lib/gitlab/setup_helper.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/gitlab/setup_helper.rb b/lib/gitlab/setup_helper.rb
index 2b7e12639be..a662b1d3311 100644
--- a/lib/gitlab/setup_helper.rb
+++ b/lib/gitlab/setup_helper.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'toml-rb'
+require "toml-rb"
module Gitlab
module SetupHelper
@@ -19,29 +19,29 @@ module Gitlab
Gitlab.config.repositories.storages.each do |key, val|
if address
- if address != val['gitaly_address']
+ if address != val["gitaly_address"]
raise ArgumentError, "Your gitlab.yml contains more than one gitaly_address."
end
- elsif URI(val['gitaly_address']).scheme != 'unix'
+ elsif URI(val["gitaly_address"]).scheme != "unix"
raise ArgumentError, "Automatic config.toml generation only supports 'unix:' addresses."
else
- address = val['gitaly_address']
+ address = val["gitaly_address"]
end
- storages << { name: key, path: storage_paths[key] }
+ storages << {name: key, path: storage_paths[key]}
end
if Rails.env.test?
- storage_path = Rails.root.join('tmp', 'tests', 'second_storage').to_s
+ storage_path = Rails.root.join("tmp", "tests", "second_storage").to_s
FileUtils.mkdir(storage_path) unless File.exist?(storage_path)
- storages << { name: 'test_second_storage', path: storage_path }
+ storages << {name: "test_second_storage", path: storage_path}
end
- config = { socket_path: address.sub(/\Aunix:/, ''), storage: storages }
- config[:auth] = { token: 'secret' } if Rails.env.test?
- config[:'gitaly-ruby'] = { dir: File.join(gitaly_dir, 'ruby') } if gitaly_ruby
- config[:'gitlab-shell'] = { dir: Gitlab.config.gitlab_shell.path }
+ config = {socket_path: address.sub(/\Aunix:/, ""), storage: storages}
+ config[:auth] = {token: "secret"} if Rails.env.test?
+ config[:'gitaly-ruby'] = {dir: File.join(gitaly_dir, "ruby")} if gitaly_ruby
+ config[:'gitlab-shell'] = {dir: Gitlab.config.gitlab_shell.path}
config[:bin_dir] = Gitlab.config.gitaly.client_path
TomlRB.dump(config)
@@ -49,7 +49,7 @@ module Gitlab
# rubocop:disable Rails/Output
def create_gitaly_configuration(dir, storage_paths, force: false)
- config_path = File.join(dir, 'config.toml')
+ config_path = File.join(dir, "config.toml")
FileUtils.rm_f(config_path) if force
File.open(config_path, File::WRONLY | File::CREAT | File::EXCL) do |f|