summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-05-11 08:19:30 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-05-11 08:19:30 +0000
commita99e8a75923cb729b22d83530c696ca7063c732d (patch)
tree3c770ab9c47278f8f1085c73a4bc8f9820b0dd5e /lib
parentf91aaccf4d0c182c01046ba38cbd9ed30b9d3684 (diff)
parentb788863c68307cc3f17e5cde92b610821c12816a (diff)
downloadgitlab-ce-a99e8a75923cb729b22d83530c696ca7063c732d.tar.gz
Merge branch 'zj-validation-initializer' into 'master'
Remove method call to deprecated method See merge request gitlab-org/gitlab-ce!18815
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gitaly_client/storage_settings.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client/storage_settings.rb b/lib/gitlab/gitaly_client/storage_settings.rb
index 8668caf0c55..9a576e463e3 100644
--- a/lib/gitlab/gitaly_client/storage_settings.rb
+++ b/lib/gitlab/gitaly_client/storage_settings.rb
@@ -5,6 +5,14 @@ module Gitlab
# directly.
class StorageSettings
DirectPathAccessError = Class.new(StandardError)
+ InvalidConfigurationError = Class.new(StandardError)
+
+ INVALID_STORAGE_MESSAGE = <<~MSG.freeze
+ Storage is invalid because it has no `path` key.
+
+ For source installations, update your config/gitlab.yml Refer to gitlab.yml.example for an updated example.
+ If you're using the Gitlab Development Kit, you can update your configuration running `gdk reconfigure`.
+ MSG
# This class will give easily recognizable NoMethodErrors
Deprecated = Class.new
@@ -12,7 +20,8 @@ module Gitlab
attr_reader :legacy_disk_path
def initialize(storage)
- raise "expected a Hash, got a #{storage.class.name}" unless storage.is_a?(Hash)
+ raise InvalidConfigurationError, "expected a Hash, got a #{storage.class.name}" unless storage.is_a?(Hash)
+ raise InvalidConfigurationError, INVALID_STORAGE_MESSAGE unless storage.has_key?('path')
# Support a nil 'path' field because some of the circuit breaker tests use it.
@legacy_disk_path = File.expand_path(storage['path'], Rails.root) if storage['path']