Daniel Erez has posted comments on this change.

Change subject: webadmin: Only add VNIC if profiles available
......................................................................


Patch Set 1:

(1 comment)

....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmModelBehaviorBase.java
Line 1013:                 List<VnicProfileView> profiles = 
(List<VnicProfileView>) returnValue;
Line 1014:                 List<VnicInstanceType> vnicInstanceTypes = new 
ArrayList<VnicInstanceType>();
Line 1015:                 List<VmNetworkInterface> nics = (argNics == null) ? 
new ArrayList<VmNetworkInterface>() : argNics;
Line 1016: 
Line 1017:                 if (nics.isEmpty() && !(profiles.isEmpty() || 
(profiles.size() == 1 && profiles.get(0) == null))) {
a bit hard to follow, can you please extract this logic?
E.g. 'if (nics.isEmpty() && noProfileExists())...'.

boolean noProfileExists() {
    return profile.isEmpty() || (profiles.size() == 1 && profiles.get(0) == 
null);
}
Line 1018:                     // create a default if none provided AND if 
there are profiles to choose from
Line 1019:                     VmNetworkInterface networkInterface = new 
VmNetworkInterface();
Line 1020:                     
networkInterface.setName(AsyncDataProvider.getNewNicName(null));
Line 1021:                     nics.add(networkInterface);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8b582711252be833300a8819c86159dd9058c1e9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to