Alona Kaplan has posted comments on this change.

Change subject: engine: Adjust SetupNetworks to accept any vlan device name
......................................................................


Patch Set 12:

(2 comments)

http://gerrit.ovirt.org/#/c/26616/12/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/SetupNetworksHelper.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/host/SetupNetworksHelper.java:

Line 190:             return;
Line 191:         }
Line 192: 
Line 193:         if (NetworkUtils.isVlan(nic)) {
Line 194:             String[] tokens = nic.getName().split("[.]", -1);
> i don't think the square brackets are mandatory.
split(".", -1) doesn't work, "." is a special char. I prefer to leave it as is 
instead of escaping it.
Line 195:             if (tokens.length == 1) {
Line 196:                 nic.setBaseInterface(nic.getName());
Line 197:                 return;
Line 198:             }


Line 199: 
Line 200:             StringBuilder sb = new StringBuilder();
Line 201:             for (int i = 0; i < tokens.length - 1; i++) {
Line 202:                 sb.append(tokens[i]).append(".");
Line 203:             }
> why not use StringUtils.join(token, '.') instead ?
Done
Line 204:             nic.setBaseInterface(StringUtils.stripEnd(sb.toString(), 
"."));
Line 205:         }
Line 206:     }
Line 207: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic08c952a7c1902d176709af7126f54ab37a0344d
Gerrit-PatchSet: 12
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: [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

Reply via email to