use of org.ovirt.engine.ui.uicommonweb.models.hosts.InterfacePropertiesAccessor in project ovirt-engine by oVirt.
the class LogicalNetworkModelParametersHelper method createAttachmentWhenAttachingTo.
private NetworkAttachment createAttachmentWhenAttachingTo(VdsNetworkInterface targetNic) {
NetworkAttachment networkAttachment = new NetworkAttachment(targetNic, networkModel.getNetwork(), NetworkCommonUtils.createDefaultIpConfiguration());
NetworkParameters netParams = networkModel.getSetupModel().getNetworkToLastDetachParams().get(networkModel.getName());
if (netParams != null) {
applyOnAttachmentParamsFrom(netParams, networkAttachment);
} else {
VdsNetworkInterface nicToTakeParamsFrom = null;
if (networkModel.hasVlan()) {
nicToTakeParamsFrom = getPotentialVlanDevice(targetNic);
} else {
nicToTakeParamsFrom = targetNic;
}
boolean newlyCreatedBond = nicToTakeParamsFrom != null && nicToTakeParamsFrom.getId() == null;
if (nicToTakeParamsFrom != null && !newlyCreatedBond) {
InterfacePropertiesAccessor.FromNic interfacePropertiesAccessor = new InterfacePropertiesAccessor.FromNic(nicToTakeParamsFrom, null);
applyOnAttachmentParamsFrom(interfacePropertiesAccessor, networkAttachment);
}
fixBootProtocolOfMgmtNetworkIfNeeded(networkAttachment);
}
return networkAttachment;
}
Aggregations