Skip to content
Snippets Groups Projects
Commit afbd7879 authored by Björn Geuken's avatar Björn Geuken Committed by GitHub
Browse files

Merge pull request #3284 from bgeuken/2.7_fix

[webui] Handle links properly when doing backend build operations
parents 3b73dab1 be9fc5f2
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5C219E7 ...@@ -8,7 +8,7 @@ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5C219E7
# Install updates from our own repository # Install updates from our own repository
sudo chmod a+w /etc/apt/sources.list.d sudo chmod a+w /etc/apt/sources.list.d
echo 'deb http://download.opensuse.org/repositories/OBS:/Server:/Unstable/xUbuntu_12.04 /' > /etc/apt/sources.list.d/opensuse.list echo 'deb http://download.opensuse.org/repositories/OBS:/Server:/2.7/xUbuntu_12.04 /' > /etc/apt/sources.list.d/opensuse.list
# We could use this to only update the package list from the OBS, # We could use this to only update the package list from the OBS,
# but apprently this is not possible anymore. So we update all package lists. # but apprently this is not possible anymore. So we update all package lists.
......
...@@ -1344,22 +1344,23 @@ class Package < ActiveRecord::Base ...@@ -1344,22 +1344,23 @@ class Package < ActiveRecord::Base
self self
end end
#### WARNING: these operations run in build object, not this package object
def rebuild(params) def rebuild(params)
backend_build_command(:rebuild, params.slice(:package, :arch, :repository)) backend_build_command(:rebuild, params[:project], params.slice(:package, :arch, :repository))
end end
def wipe_binaries(params) def wipe_binaries(params)
backend_build_command(:wipe, params.slice(:package, :arch, :repository)) backend_build_command(:wipe, params[:project], params.slice(:package, :arch, :repository))
end end
def abort_build(params) def abort_build(params)
backend_build_command(:abortbuild, params.slice(:package, :arch, :repository)) backend_build_command(:abortbuild, params[:project], params.slice(:package, :arch, :repository))
end end
def backend_build_command(command, params) def backend_build_command(command, build_project, params)
begin begin
Suse::Backend.post("/build/#{URI.escape(project.name)}?cmd=#{command}&#{params.to_query}", '') Suse::Backend.post("/build/#{URI.escape(build_project)}?cmd=#{command}&#{params.to_query}", '')
rescue ActiveXML::Transport::Error, Timeout::Error => e rescue ActiveXML::Transport::Error, Timeout::Error, Project::WritePermissionError => e
errors.add(:base, e.message) errors.add(:base, e.message)
return false return false
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment