Source:
<code>protected void executeCommand() { String bond = null; String address = getParameters().getAddress(); String subnet = StringHelper.isNullOrEmpty(getParameters().getSubnet()) ? getParameters().getNetwork() .getsubnet() : getParameters().getSubnet(); String gateway = StringHelper.isNullOrEmpty(getParameters().getGateway()) ? "" : getParameters().getGateway(); java.util.ArrayList<String> nics = new java.util.ArrayList<String>(); nics.add(getParameters().getInterface().getName()); if (getParameters().getInterface().getBonded() != null && getParameters().getInterface().getBonded()) { nics.clear(); bond = getParameters().getInterface().getName(); List<VdsNetworkInterface> interfaces = DbFacade.getInstance().getInterfaceDAO().getAllInterfacesForVds( getParameters().getVdsId()); for (VdsNetworkInterface i : interfaces) { if (StringHelper.EqOp(i.getBondName(), getParameters().getInterface().getName())) { nics.add(i.getName()); } } } NetworkVdsmVDSCommandParameters parameters = new NetworkVdsmVDSCommandParameters(getParameters().getVdsId(), <START> logicalNetwork, <END> bond, nics.toArray(new String[] {}), address, subnet, gateway, getParameters().getBondingOptions(), getParameters().getBootProtocol()); VDSReturnValue retVal = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.AddNetwork, parameters); if (retVal.getSucceeded()) { retVal = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.CollectVdsNetworkData, new VdsIdAndVdsVDSCommandParametersBase(getParameters().getVdsId())); if (retVal.getSucceeded()) { Guid groupId = DbFacade.getInstance().getVdsDAO().get(getParameters().getVdsId()).getvds_group_id(); AttachNetworkToVdsGroupCommand.SetNetworkStatus(groupId, getParameters().getNetwork()); setSucceeded(true); } } }</code><technical_language>in file indentation, horrible :-)</technical_language>

Target:
protected void executeCommand() { String bond = null; T params = getParameters(); String address = params.getAddress(); String subnet = StringHelper.isNullOrEmpty(params.getSubnet()) ? params.getNetwork() .getsubnet() : params.getSubnet(); String gateway = StringHelper.isNullOrEmpty(params.getGateway()) ? "" : params.getGateway(); java.util.ArrayList<String> nics = new java.util.ArrayList<String>(); nics.add(params.getInterface().getName()); if (params.getInterface().getBonded() != null && params.getInterface().getBonded()) { nics.clear(); bond = params.getInterface().getName(); List<VdsNetworkInterface> interfaces = DbFacade.getInstance().getInterfaceDAO().getAllInterfacesForVds( params.getVdsId()); for (VdsNetworkInterface i : interfaces) { if (StringHelper.EqOp(i.getBondName(), params.getInterface().getName())) { nics.add(i.getName()); } } } NetworkVdsmVDSCommandParameters parameters = new NetworkVdsmVDSCommandParameters(params.getVdsId(), logicalNetwork, bond, nics.toArray(new String[] {}), address, subnet, gateway, params.getBondingOptions(), params.getBootProtocol()); VDSReturnValue retVal = Backend.getInstance().getResourceManager() .RunVdsCommand(VDSCommandType.AddNetwork, parameters); if (retVal.getSucceeded()) { retVal = Backend .getInstance() .getResourceManager() .RunVdsCommand(VDSCommandType.CollectVdsNetworkData, new VdsIdAndVdsVDSCommandParametersBase(params.getVdsId())); if (retVal.getSucceeded()) { Guid groupId = DbFacade.getInstance().getVdsDAO().get(params.getVdsId()).getvds_group_id(); AttachNetworkToVdsGroupCommand.SetNetworkStatus(groupId, params.getNetwork()); setSucceeded(true); } } }