Skip to content

Commit

Permalink
Merge pull request #3284 from bgeuken/2.7_fix
Browse files Browse the repository at this point in the history
[webui] Handle links properly when doing backend build operations
  • Loading branch information
bgeuken committed Jun 28, 2017
2 parents 3b73dab + be9fc5f commit afbd787
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/ci/obs_testsuite_travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5C219E7

# Install updates from our own repository
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,
# but apprently this is not possible anymore. So we update all package lists.
Expand Down
13 changes: 7 additions & 6 deletions src/api/app/models/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1344,22 +1344,23 @@ def api_obj
self
end

#### WARNING: these operations run in build object, not this package object
def rebuild(params)
backend_build_command(:rebuild, params.slice(:package, :arch, :repository))
backend_build_command(:rebuild, params[:project], params.slice(:package, :arch, :repository))
end

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

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

def backend_build_command(command, params)
def backend_build_command(command, build_project, params)
begin
Suse::Backend.post("/build/#{URI.escape(project.name)}?cmd=#{command}&#{params.to_query}", '')
rescue ActiveXML::Transport::Error, Timeout::Error => e
Suse::Backend.post("/build/#{URI.escape(build_project)}?cmd=#{command}&#{params.to_query}", '')
rescue ActiveXML::Transport::Error, Timeout::Error, Project::WritePermissionError => e
errors.add(:base, e.message)
return false
end
Expand Down

0 comments on commit afbd787

Please sign in to comment.