Source:
<code>private static void addHostBondDevices(VDS vds, Map<String, Object> xmlRpcStruct) { Map<String, Map<String, Object>> bonds = (Map<String, Map<String, Object>>) xmlRpcStruct.get(VdsProperties.NETWORK_BONDINGS); if (bonds != null) { boolean cfgEntriesDeprecated = FeatureSupported.cfgEntriesDeprecated(vds.getVdsGroupCompatibilityVersion()); for (Entry<String, Map<String, Object>> entry : bonds.entrySet()) { VdsNetworkInterface bond = new Bond(); updateCommonInterfaceData(bond, vds, entry); bond.setBonded(true); Map<String, Object> bondProperties = entry.getValue(); if (bondProperties != null) { bond.setMacAddress((String) bondProperties.get("hwaddr")); if (bondProperties.get("slaves") != null) { addBondDeviceToHost(vds, bond, (Object[]) bondProperties.get("slaves")); } Object bondOptions = null; if (cfgEntriesDeprecated) { Map<String, Object> bondOptionsMap = (Map<String, Object>)bondProperties.get("opts"); String miimon = (String)bondOptionsMap.get("miimon"); <START> String mode = (String)bondOptionsMap.get("mode"); <END> bondOptions = String.format("mode=%s miimon=%s", mode, miimon); } else { Map<String, Object> config = (Map<String, Object>) bondProperties.get("cfg"); bondOptions = (config == null) ? null : config.get("BONDING_OPTS"); } if (bondOptions != null) { bond.setBondOptions(bondOptions.toString()); } } } } }</code><technical_language>"miimon" "mode" report is guaranteed</technical_language>

Target:
private static void addHostBondDevices(VDS vds, Map<String, Object> xmlRpcStruct) { Map<String, Map<String, Object>> bonds = (Map<String, Map<String, Object>>) xmlRpcStruct.get(VdsProperties.NETWORK_BONDINGS); if (bonds != null) { boolean cfgEntriesDeprecated = FeatureSupported.cfgEntriesDeprecated(vds.getVdsGroupCompatibilityVersion()); for (Entry<String, Map<String, Object>> entry : bonds.entrySet()) { VdsNetworkInterface bond = new Bond(); updateCommonInterfaceData(bond, vds, entry); bond.setBonded(true); Map<String, Object> bondProperties = entry.getValue(); if (bondProperties != null) { bond.setMacAddress((String) bondProperties.get("hwaddr")); if (bondProperties.get("slaves") != null) { addBondDeviceToHost(vds, bond, (Object[]) bondProperties.get("slaves")); } Object bondOptions = null; if (cfgEntriesDeprecated) { Map<String, Object> bondOptionsMap = new HashMap<>(); bondOptionsMap.putAll((Map<String, Object>) bondProperties.get("opts")); String bondOptionsString = ""; String mode = (String) bondOptionsMap.get("mode"); String miimon = (String) bondOptionsMap.get("miimon"); if (mode != null && miimon != null) { bondOptionsString = String.format("mode=%s miimon=%s", mode, miimon); bondOptionsMap.remove("mode"); bondOptionsMap.remove("miimon"); } for (Map.Entry<String, Object> optionEntry : bondOptionsMap.entrySet()) { bondOptionsString = String.format("%s %s=%s", bondOptionsString, optionEntry.getKey(), optionEntry.getValue()); } bondOptions = bondOptionsString.isEmpty() ? null : bondOptionsString; } else { Map<String, Object> config = (Map<String, Object>) bondProperties.get("cfg"); bondOptions = (config == null) ? null : config.get("BONDING_OPTS"); } if (bondOptions != null) { bond.setBondOptions(bondOptions.toString()); } } } } }