Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 21:09:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 21:09:25 +0300
commit967812838c7e7742729a4c7aeb9859f98a509622 (patch)
tree22db2e6642be51cb12535db7863331457e5523c3 /app/workers
parent074d013e1eb3f6e0c27f96a3be8b9361254c8a98 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/authorized_keys_worker.rb10
-rw-r--r--app/workers/gitlab_shell_worker.rb2
2 files changed, 7 insertions, 5 deletions
diff --git a/app/workers/authorized_keys_worker.rb b/app/workers/authorized_keys_worker.rb
index b2333033e56..eabfd89ba60 100644
--- a/app/workers/authorized_keys_worker.rb
+++ b/app/workers/authorized_keys_worker.rb
@@ -3,7 +3,7 @@
class AuthorizedKeysWorker
include ApplicationWorker
- PERMITTED_ACTIONS = [:add_key, :remove_key].freeze
+ PERMITTED_ACTIONS = %w[add_key remove_key].freeze
feature_category :source_code_management
urgency :high
@@ -13,11 +13,13 @@ class AuthorizedKeysWorker
def perform(action, *args)
return unless Gitlab::CurrentSettings.authorized_keys_enabled?
- case action
- when :add_key
+ case action.to_s
+ when 'add_key'
authorized_keys.add_key(*args)
- when :remove_key
+ when 'remove_key'
authorized_keys.remove_key(*args)
+ else
+ raise "Unknown action: #{action.inspect}"
end
end
diff --git a/app/workers/gitlab_shell_worker.rb b/app/workers/gitlab_shell_worker.rb
index 0db794793d4..b104d3c681e 100644
--- a/app/workers/gitlab_shell_worker.rb
+++ b/app/workers/gitlab_shell_worker.rb
@@ -13,7 +13,7 @@ class GitlabShellWorker # rubocop:disable Scalability/IdempotentWorker
# enqueued in the previous release, so handle them here.
#
# See https://gitlab.com/gitlab-org/gitlab/-/issues/25095 for more details
- if AuthorizedKeysWorker::PERMITTED_ACTIONS.include?(action)
+ if AuthorizedKeysWorker::PERMITTED_ACTIONS.include?(action.to_s)
AuthorizedKeysWorker.new.perform(action, *arg)
return