summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2016-07-18 17:28:26 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2016-07-21 18:33:51 -0400
commit89589007aee6780c3dea2d44df12e9509a22f975 (patch)
treecfc249d0bd225372be0b6c4d411e261073a1ab3d /config
parent72f59ddf4c9d276bd565892c0cf79d5622906090 (diff)
downloadgitlab-ce-89589007aee6780c3dea2d44df12e9509a22f975.tar.gz
Skip repository storage path valitaions on test environment
Storage path are not created until `TestEnv.init`, so we must skip their validation on initialization.
Diffstat (limited to 'config')
-rw-r--r--config/initializers/6_validations.rb16
1 files changed, 10 insertions, 6 deletions
diff --git a/config/initializers/6_validations.rb b/config/initializers/6_validations.rb
index 83acdc8ab54..37746968675 100644
--- a/config/initializers/6_validations.rb
+++ b/config/initializers/6_validations.rb
@@ -13,13 +13,17 @@ def storage_validation_error(message)
raise "#{message}. Please fix this in your gitlab.yml before starting GitLab."
end
-storage_validation_error('No repository storage path defined') if Gitlab.config.repositories.storages.empty?
+def validate_storages
+ storage_validation_error('No repository storage path defined') if Gitlab.config.repositories.storages.empty?
-Gitlab.config.repositories.storages.each do |name, path|
- storage_validation_error("\"#{name}\" is not a valid storage name") unless storage_name_valid?(name)
+ Gitlab.config.repositories.storages.each do |name, path|
+ storage_validation_error("\"#{name}\" is not a valid storage name") unless storage_name_valid?(name)
- parent_name, _parent_path = find_parent_path(name, path)
- if parent_name
- storage_validation_error("#{name} is a nested path of #{parent_name}. Nested paths are not supported for repository storages")
+ parent_name, _parent_path = find_parent_path(name, path)
+ if parent_name
+ storage_validation_error("#{name} is a nested path of #{parent_name}. Nested paths are not supported for repository storages")
+ end
end
end
+
+validate_storages unless Rails.env.test?