Commit ceb23a62 authored by ash's avatar ash

Use :warn instead of :error for invalid commands.

parent 7626d957
...@@ -18,7 +18,7 @@ class GitlabKeys ...@@ -18,7 +18,7 @@ class GitlabKeys
when 'add-key'; add_key when 'add-key'; add_key
when 'rm-key'; rm_key when 'rm-key'; rm_key
else else
$logger.error "Attempt to execute invalid gitlab-keys command #{@command.inspect}." $logger.warn "Attempt to execute invalid gitlab-keys command #{@command.inspect}."
puts 'not allowed' puts 'not allowed'
false false
end end
......
...@@ -32,7 +32,7 @@ class GitlabProjects ...@@ -32,7 +32,7 @@ class GitlabProjects
when 'import-project'; import_project when 'import-project'; import_project
when 'fork-project'; fork_project when 'fork-project'; fork_project
else else
$logger.error "Attempt to execute invalid gitlab-projects command #{@command.inspect}." $logger.warn "Attempt to execute invalid gitlab-projects command #{@command.inspect}."
puts 'not allowed' puts 'not allowed'
false false
end end
......
...@@ -63,10 +63,10 @@ describe GitlabKeys do ...@@ -63,10 +63,10 @@ describe GitlabKeys do
gitlab_keys.exec gitlab_keys.exec
end end
it 'should log an error on unknown commands' do it 'should log a warning on unknown commands' do
gitlab_keys = build_gitlab_keys('nooope') gitlab_keys = build_gitlab_keys('nooope')
gitlab_keys.stub(puts: nil) gitlab_keys.stub(puts: nil)
$logger.should_receive(:error).with('Attempt to execute invalid gitlab-keys command "nooope".') $logger.should_receive(:warn).with('Attempt to execute invalid gitlab-keys command "nooope".')
gitlab_keys.exec gitlab_keys.exec
end end
end end
......
...@@ -180,9 +180,9 @@ describe GitlabProjects do ...@@ -180,9 +180,9 @@ describe GitlabProjects do
gitlab_projects.exec gitlab_projects.exec
end end
it 'should log a message for unknown commands' do it 'should log a warning for unknown commands' do
gitlab_projects = build_gitlab_projects('hurf-durf', repo_name) gitlab_projects = build_gitlab_projects('hurf-durf', repo_name)
$logger.should_receive(:error).with('Attempt to execute invalid gitlab-projects command "hurf-durf".') $logger.should_receive(:warn).with('Attempt to execute invalid gitlab-projects command "hurf-durf".')
gitlab_projects.exec gitlab_projects.exec
end end
end 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