diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 12:09:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 12:09:17 +0000 |
commit | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (patch) | |
tree | f1096c68e457aef7f5201acd16e4a751ff538026 /lib/tasks | |
parent | 18f7828977b74bf6e5153594a098ef90e773b3b7 (diff) | |
download | gitlab-ce-cd52759ee33051b8ad7b88b02ba7954e4fad7018.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/shell.rake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index ba3e19caf3b..6586699f8ba 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -89,10 +89,12 @@ namespace :gitlab do puts "" end - Gitlab::Shell.new.remove_all_keys + authorized_keys = Gitlab::AuthorizedKeys.new + + authorized_keys.clear Key.find_in_batches(batch_size: 1000) do |keys| - unless Gitlab::Shell.new.batch_add_keys(keys) + unless authorized_keys.batch_add_keys(keys) puts "Failed to add keys...".color(:red) exit 1 end @@ -103,7 +105,7 @@ namespace :gitlab do end def ensure_write_to_authorized_keys_is_enabled - return if Gitlab::CurrentSettings.current_application_settings.authorized_keys_enabled + return if Gitlab::CurrentSettings.authorized_keys_enabled? puts authorized_keys_is_disabled_warning @@ -113,7 +115,7 @@ namespace :gitlab do end puts 'Enabling the "Write to authorized_keys file" setting...' - Gitlab::CurrentSettings.current_application_settings.update!(authorized_keys_enabled: true) + Gitlab::CurrentSettings.update!(authorized_keys_enabled: true) puts 'Successfully enabled "Write to authorized_keys file"!' puts '' |