Skip to content

Commit

Permalink
[api] make delete operation reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jul 9, 2015
1 parent fb34fbb commit 70a24f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/api/app/controllers/source_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ def delete_project

Project.transaction do
logger.info "destroying project object #{pro.name}"
params[:user] = User.current.login
path = pro.source_path
path << build_query_from_hash(params, [:user, :comment])

pro.revoke_requests
pro.destroy

params[:user] = User.current.login
path = "/source/#{pro.name}"
path << build_query_from_hash(params, [:user, :comment])
Suse::Backend.delete path
logger.debug "delete request to backend: #{path}"
end
Expand Down Expand Up @@ -306,13 +307,13 @@ def delete_package

project = nil
project = tpkg.project if tpkg and tpkg.name == "_product"
path = tpkg.source_path

# we need to keep this order to delete first the api model
tpkg.revoke_requests
tpkg.destroy

params[:user] = User.current
path = tpkg.source_path
path << build_query_from_hash(params, [:user, :comment])
Suse::Backend.delete path

Expand Down

0 comments on commit 70a24f2

Please sign in to comment.