Moti Asayag has posted comments on this change.
Change subject: core: treat 'special' devices as managed when importing
templates
......................................................................
Patch Set 1:
(3 comments)
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfTemplateReader.java
Line 150: // OTHER
Line 151: case 0:
Line 152: if (node.SelectSingleNode(OvfProperties.VMD_TYPE,
_xmlNS) != null
Line 153: &&
StringUtils.isNotEmpty(node.SelectSingleNode(OvfProperties.VMD_TYPE,
_xmlNS).InnerText)) {
Line 154: VmDeviceGeneralType type =
VmDeviceGeneralType.forValue(String.valueOf(node.SelectSingleNode(OvfProperties.VMD_TYPE,
_xmlNS).InnerText));
isn't String.valueOf() is redundant here? InnerText is already a String.
Line 155: String device =
String.valueOf(node.SelectSingleNode(OvfProperties.VMD_DEVICE,
_xmlNS).InnerText);
Line 156: // special devices are treated as managed devices
but still have the OTHER OVF ResourceType
Line 157: if (VmDeviceCommonUtils.isSpecialDevice(device,
type)) {
Line 158: readVmDevice(node, _vmTemplate,
Guid.newGuid(), Boolean.TRUE);
Line 151: case 0:
Line 152: if (node.SelectSingleNode(OvfProperties.VMD_TYPE,
_xmlNS) != null
Line 153: &&
StringUtils.isNotEmpty(node.SelectSingleNode(OvfProperties.VMD_TYPE,
_xmlNS).InnerText)) {
Line 154: VmDeviceGeneralType type =
VmDeviceGeneralType.forValue(String.valueOf(node.SelectSingleNode(OvfProperties.VMD_TYPE,
_xmlNS).InnerText));
Line 155: String device =
String.valueOf(node.SelectSingleNode(OvfProperties.VMD_DEVICE,
_xmlNS).InnerText);
same here.
Line 156: // special devices are treated as managed devices
but still have the OTHER OVF ResourceType
Line 157: if (VmDeviceCommonUtils.isSpecialDevice(device,
type)) {
Line 158: readVmDevice(node, _vmTemplate,
Guid.newGuid(), Boolean.TRUE);
Line 159: } else {
Line 160: readVmDevice(node, _vmTemplate,
Guid.newGuid(), Boolean.FALSE);
Line 161: }
Line 162: } else {
Line 163: readVmDevice(node, _vmTemplate, Guid.newGuid(),
Boolean.FALSE);
Line 164: }
there are 3 calls to readVmDevice with a different isManagend value.
It can be replaced with a single call before the 'break'.
Line 165: break;
Line 166:
Line 167: }
Line 168: }
--
To view, visit http://gerrit.ovirt.org/18188
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I95c1c2f1e2f45a1863c28c5fcaeb6274f2d28b4e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches