summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-02 13:47:25 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-02 13:47:25 +0000
commit0ef0150d8c5ff6fec88c64056ee8c788aed0aa14 (patch)
tree410c38b760f83294b776a3fe103b30884b252d33 /lib
parentf003ad59dd43bb0e80f23b805c3d1b0f9d0108b1 (diff)
parent1dda34f306a94a4046d7150f5dc11a6fde360dd0 (diff)
downloadgitlab-ce-0ef0150d8c5ff6fec88c64056ee8c788aed0aa14.tar.gz
Merge branch 'destroy_duplicate_keys' of /home/git/repositories/gitlab/gitlabhq
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/migrate/migrate_keys.rake5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tasks/migrate/migrate_keys.rake b/lib/tasks/migrate/migrate_keys.rake
index b13d984907b..969ba6dc15e 100644
--- a/lib/tasks/migrate/migrate_keys.rake
+++ b/lib/tasks/migrate/migrate_keys.rake
@@ -1,15 +1,20 @@
desc "GITLAB | Migrate SSH Keys"
task migrate_keys: :environment do
puts "This will add fingerprint to ssh keys in db"
+ puts "If you have duplicate keys https://github.com/gitlabhq/gitlabhq/issues/4453 all but the first will be deleted".yellow
ask_to_continue
Key.find_each(batch_size: 20) do |key|
if key.valid? && key.save
print '.'
+ elsif key.fingerprint.present?
+ puts "\nDeleting #{key.inspect}".yellow
+ key.destroy
else
print 'F'
end
end
+ print "\n"
end