Commit ceb23a62 authored by ash's avatar ash

Use :warn instead of :error for invalid commands.

parent 7626d957
......@@ -18,7 +18,7 @@ class GitlabKeys
when 'add-key'; add_key
when 'rm-key'; rm_key
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'
false
end
......
......@@ -32,7 +32,7 @@ class GitlabProjects
when 'import-project'; import_project
when 'fork-project'; fork_project
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'
false
end
......
......@@ -63,10 +63,10 @@ describe GitlabKeys do
gitlab_keys.exec
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.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
end
end
......
......@@ -180,9 +180,9 @@ describe GitlabProjects do
gitlab_projects.exec
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)
$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
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