Skip to content

Commit

Permalink
[api] do not complain about excluded patchinfos on release request cr…
Browse files Browse the repository at this point in the history
…eation
  • Loading branch information
adrianschroeter committed Mar 16, 2012
1 parent 98e017e commit b66083e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/api/app/controllers/request_controller.rb
Expand Up @@ -425,14 +425,18 @@ def create_create
end
pkg.db_project.repositories.each do |repo|
if repo and repo.architectures.first
binaries = REXML::Document.new( backend_get("/build/#{URI.escape(pkg.db_project.name)}/#{URI.escape(repo.name)}/#{URI.escape(repo.architectures.first.name)}/#{URI.escape(pkg.name)}") )
l = binaries.get_elements("binarylist/binary")
if l and l.count > 0
found_patchinfo = 1
else
render_error :status => 400, :errorcode => 'build_not_finished',
:message => "patchinfo is not yet build for repository '#{repo.name}'"
return
# skip excluded patchinfos
status = state.get_elements("/resultlist/result[@repository='#{repo.name}'+and+@arch='#{repo.architectures.first.name}']").first
unless status and s=status.get_elements("/status[@package='#{pkg.name}']").first and s.attributes['code'] == "excluded"
binaries = REXML::Document.new( backend_get("/build/#{URI.escape(pkg.db_project.name)}/#{URI.escape(repo.name)}/#{URI.escape(repo.architectures.first.name)}/#{URI.escape(pkg.name)}") )
l = binaries.get_elements("binarylist/binary")
if l and l.count > 0
found_patchinfo = 1
else
render_error :status => 400, :errorcode => 'build_not_finished',
:message => "patchinfo is not yet build for repository '#{repo.name}'"
return
end
end
end
end
Expand Down
1 change: 1 addition & 0 deletions src/api/test/functional/maintenance_test.rb
Expand Up @@ -824,6 +824,7 @@ def test_create_maintenance_project_and_release_packages
get "/source/#{incidentProject}/patchinfo/_patchinfo"
assert_response :success
assert_tag( :tag => "patchinfo", :attributes => { :incident => incidentID } )
#FIXME: add another patchinfo pointing to a third place
# add required informations about the update
pi = ActiveXML::Base.new( @response.body )
pi.summary.text = "if you are bored"
Expand Down

0 comments on commit b66083e

Please sign in to comment.