summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-08-01 07:45:04 +0200
committerGabriel Mazetto <brodock@gmail.com>2017-08-01 07:45:04 +0200
commit2c2609620356a4693ec96f988bc96cb4601be5e8 (patch)
tree8dc9113de113792eac8562547fe4e5639439c2a2
parent597e619080c393daa765bf6e5de74f60121d1f0e (diff)
downloadgitlab-ce-28283-legacy-storage-format.tar.gz
Small refactor in LegacyNamespace and moved back send_update_instructions28283-legacy-storage-format
-rw-r--r--app/models/concerns/storage/legacy_namespace.rb11
-rw-r--r--app/models/namespace.rb6
2 files changed, 8 insertions, 9 deletions
diff --git a/app/models/concerns/storage/legacy_namespace.rb b/app/models/concerns/storage/legacy_namespace.rb
index 5cbd52e5c75..5ab5c80a2f5 100644
--- a/app/models/concerns/storage/legacy_namespace.rb
+++ b/app/models/concerns/storage/legacy_namespace.rb
@@ -7,7 +7,7 @@ module Storage
raise Gitlab::UpdatePathError.new('Namespace cannot be moved, because at least one project has tags in container registry')
end
- # Move the namespace directory in all storages paths used by member projects
+ # Move the namespace directory in all storage paths used by member projects
repository_storage_paths.each do |repository_storage_path|
# Ensure old directory exists before moving it
gitlab_shell.add_namespace(repository_storage_path, full_path_was)
@@ -49,12 +49,6 @@ module Storage
private
- def send_update_instructions
- projects.each do |project|
- project.send_move_instructions("#{full_path_was}/#{project.path}")
- end
- end
-
def old_repository_storage_paths
@old_repository_storage_paths ||= repository_storage_paths
end
@@ -76,8 +70,7 @@ module Storage
new_path = "#{full_path}+#{id}+deleted"
if gitlab_shell.mv_namespace(repository_storage_path, full_path, new_path)
- message = "Namespace directory \"#{full_path}\" moved to \"#{new_path}\""
- Gitlab::AppLogger.info message
+ Gitlab::AppLogger.info %Q(Namespace directory "#{full_path}" moved to "#{new_path}")
# Remove namespace directroy async with delay so
# GitLab has time to remove all projects first
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 010c97c507e..6073fb94a3f 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -124,6 +124,12 @@ class Namespace < ActiveRecord::Base
all_projects.any?(&:has_container_registry_tags?)
end
+ def send_update_instructions
+ projects.each do |project|
+ project.send_move_instructions("#{full_path_was}/#{project.path}")
+ end
+ end
+
def kind
type == 'Group' ? 'group' : 'user'
end