Commit 27805ccf authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Implement EE specific changes for new storages config structure

parent 80a1afff
......@@ -7,7 +7,7 @@ module Projects
end
def execute(new_repository_storage_key)
new_storage_path = Gitlab.config.repositories.storages[new_repository_storage_key]
new_storage_path = Gitlab.config.repositories.storages[new_repository_storage_key]['path']
result = move_storage(project.path_with_namespace, new_storage_path)
if project.wiki.repository_exists?
......
......@@ -48,9 +48,10 @@ namespace :gitlab do
warn_user_is_not_gitlab
remove_flag = ENV['REMOVE']
Gitlab.config.repositories.storages.each do |name, repo_root|
Gitlab.config.repositories.storages.each do |name, repository_storage|
repo_root = repository_storage['path'].chomp('/')
# Look for global repos (legacy, depth 1) and normal repos (depth 2)
IO.popen(%W(find #{repo_root.chomp('/')} -mindepth 1 -maxdepth 2 -name *+moved*.git)) do |find|
IO.popen(%W(find #{repo_root} -mindepth 1 -maxdepth 2 -name *+moved*.git)) do |find|
find.each_line do |path|
path.chomp!
if remove_flag
......
......@@ -1961,7 +1961,10 @@ describe Project, models: true do
FileUtils.mkdir('tmp/tests/storage_a')
FileUtils.mkdir('tmp/tests/storage_b')
storages = { 'a' => 'tmp/tests/storage_a', 'b' => 'tmp/tests/storage_b' }
storages = {
'a' => { 'path' => 'tmp/tests/storage_a' },
'b' => { 'path' => 'tmp/tests/storage_b' }
}
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
end
......
......@@ -11,7 +11,10 @@ describe Projects::UpdateRepositoryStorageService, services: true do
FileUtils.mkdir('tmp/tests/storage_a')
FileUtils.mkdir('tmp/tests/storage_b')
storages = { 'a' => 'tmp/tests/storage_a', 'b' => 'tmp/tests/storage_b' }
storages = {
'a' => { 'path' => 'tmp/tests/storage_a' },
'b' => { 'path' => 'tmp/tests/storage_b' }
}
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
allow(subject).to receive(:gitlab_shell).and_return(gitlab_shell)
......
......@@ -105,7 +105,10 @@ describe Projects::UpdateService, services: true do
FileUtils.mkdir('tmp/tests/storage_a')
FileUtils.mkdir('tmp/tests/storage_b')
storages = { 'a' => 'tmp/tests/storage_a', 'b' => 'tmp/tests/storage_b' }
storages = {
'a' => { 'path' => 'tmp/tests/storage_a' },
'b' => { 'path' => 'tmp/tests/storage_b' }
}
allow(Gitlab.config.repositories).to receive(:storages).and_return(storages)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment