Arik Hadas has posted comments on this change.

Change subject: restapi: fix usb mapping on update vm call
......................................................................


Patch Set 1: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmHandler.java
Line 422:             VDSGroup vdsGroup,
Line 423:             List<String> messages) {
Line 424:         boolean retVal = true;
Line 425:         if (usbPolicy == null) {
Line 426:             
messages.add(VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_USB_POLICY.toString());
rolled back, as there is no need to raise an error
Line 427:             retVal = false;
Line 428:         } else if (UsbPolicy.ENABLED_NATIVE.equals(usbPolicy)) {
Line 429:             if (!Config.<Boolean> 
GetValue(ConfigValues.NativeUSBEnabled, vdsGroup.getcompatibility_version()
Line 430:                     .getValue())) {


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/UsbResourceUtils.java
Line 51:         }
Line 52:         else {
Line 53:             if (!usb.isEnabled())
Line 54:                 return UsbPolicy.DISABLED;
Line 55:             else {
I refactored this method to be more readable
Line 56:                 if (usb.isSetType()) {
Line 57:                     UsbType usbType = UsbType.fromValue(usb.getType());
Line 58:                     return mapUsbTypeToPolicy(usbType);
Line 59:                 }


Line 56:                 if (usb.isSetType()) {
Line 57:                     UsbType usbType = UsbType.fromValue(usb.getType());
Line 58:                     return mapUsbTypeToPolicy(usbType);
Line 59:                 }
Line 60:                 else {
Done
Line 61:                     return currentPolicy == UsbPolicy.DISABLED ? null 
: currentPolicy;
Line 62:                 }
Line 63:             }
Line 64:         }


Line 63:             }
Line 64:         }
Line 65:     }
Line 66: 
Line 67:     private static UsbPolicy mapUsbTypeToPolicy(UsbType usbType) {
Done
Line 68:         if (usbType == null)
Line 69:             return null;
Line 70: 
Line 71:         switch (usbType) {


--
To view, visit http://gerrit.ovirt.org/9792
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If74bf6ede2fc0f932db8dfcd7951b6bcf90b7744
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to