Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 675814 Details for
Bug 892628
RESTAPI: Internal server error 500 on wrong CPU-pinning format
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch
0001-engine-throw-http-400-if-validation-fails.patch (text/plain), 2.94 KB, created by
Laszlo Hornyak
on 2013-01-09 20:26:00 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Laszlo Hornyak
Created:
2013-01-09 20:26:00 UTC
Size:
2.94 KB
patch
obsolete
>From 8073ac72cb110d6b29e9531c15f70faa46ca1ccd Mon Sep 17 00:00:00 2001 >From: Laszlo Hornyak <lhornyak@redhat.com> >Date: Wed, 9 Jan 2013 21:12:12 +0100 >Subject: [PATCH] engine: throw http 400 if validation fails > >Modifies the pinning validation so that it throws a BadrequestException >rather than the more generic IllegalArgumentException, this will result >in returning http 400 if validation fails. > >Change-Id: Id709ee3e1f4b4dffffadf316f222a9b2c751f1d8 >Signed-off-by: Laszlo Hornyak <lhornyak@redhat.com> >Bug-Url: https://bugzilla.redhat.com/892628 >--- > backend/manager/modules/restapi/types/pom.xml | 5 +++++ > .../ovirt/engine/api/restapi/types/VmMapper.java | 7 ++++--- > 2 files changed, 9 insertions(+), 3 deletions(-) > >diff --git a/backend/manager/modules/restapi/types/pom.xml b/backend/manager/modules/restapi/types/pom.xml >index 0d0fa5d..7aa1b3c 100644 >--- a/backend/manager/modules/restapi/types/pom.xml >+++ b/backend/manager/modules/restapi/types/pom.xml >@@ -59,5 +59,10 @@ > <scope>provided</scope> > </dependency> > >+ <dependency> >+ <groupId>org.jboss.resteasy</groupId> >+ <artifactId>resteasy-jaxrs</artifactId> >+ <version>2.3.2.Final</version> >+ </dependency> > </dependencies> > </project> >diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java >index dc8e5bb..8c356cb 100644 >--- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java >+++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java >@@ -7,6 +7,7 @@ import java.util.LinkedHashSet; > import java.util.List; > import java.util.Set; > >+import org.jboss.resteasy.spi.BadRequestException; > import org.ovirt.engine.api.common.util.StatusUtils; > import org.ovirt.engine.api.common.util.TimeZoneMapping; > import org.ovirt.engine.api.model.Boot; >@@ -966,18 +967,18 @@ public class VmMapper { > static VCpuPin stringToVCpupin(final String strCpu) { > final String[] strPin = strCpu.split("#"); > if (strPin.length != 2) { >- throw new IllegalArgumentException("Bad format: " + strCpu); >+ throw new BadRequestException("Bad format: " + strCpu); > } > final VCpuPin pin = new VCpuPin(); > try { > pin.setVcpu(Integer.parseInt(strPin[0])); > } catch (NumberFormatException e) { >- throw new IllegalArgumentException("Bad format: " + strCpu, e); >+ throw new BadRequestException("Bad format: " + strCpu, e); > } > if (strPin[1].matches("\\^?(\\d+(\\-\\d+)?)(,\\^?((\\d+(\\-\\d+)?)))*")) { > pin.setCpuSet(strPin[1]); > } else { >- throw new IllegalArgumentException("Bad format: " + strPin[1]); >+ throw new BadRequestException("Bad format: " + strPin[1]); > } > return pin; > } >-- >1.7.7.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 892628
: 675814