import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.ovsdb.lib.error.SchemaVersionMismatchException;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalSwitchAttributes;
public class HwvtepSouthboundUtil {
private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundUtil.class);
+ private static final String SCHEMA_VERSION_MISMATCH =
+ "{} column for {} table is not supported by this version of the {} schema: {}";
private static InstanceIdentifierCodec instanceIdentifierCodec;
return String.valueOf(
connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
+
+
+ public static void schemaMismatchLog(String column, String table, SchemaVersionMismatchException ex) {
+ LOG.debug(SCHEMA_VERSION_MISMATCH, column, table, "hw_vtep", ex.getMessage());
+ }
}
package org.opendaylight.ovsdb.hwvtepsouthbound.transact;
+import static org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepSouthboundUtil.schemaMismatchLog;
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
import java.util.Collection;
setTunnels(transaction, iid, physicalSwitch, physicalSwitchAugmentation,
operationalPhysicalSwitchOptional.isPresent());
} catch (SchemaVersionMismatchException e) {
- LOG.debug("tunnels table unsupported for this version of HWVTEP schema", e);
+ schemaMismatchLog("tunnels", "Physical_Switch", e);
}
if (!operationalPhysicalSwitchOptional.isPresent()) {
//create a physical switch
*/
package org.opendaylight.ovsdb.southbound;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
+
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import org.opendaylight.ovsdb.schema.openvswitch.Qos;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IetfInetUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Address;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
try {
protocols = bridge.getProtocolsColumn().getData();
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.warn("protocols not supported by this version of ovsdb", e);
+ schemaMismatchLog("protocols", "Bridge", e);
}
List<ProtocolEntry> protocolList = new ArrayList<>();
if (protocols != null && protocols.size() > 0) {
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.ovsdb.lib.error.SchemaVersionMismatchException;
+import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
public class SouthboundUtil {
private static final Logger LOG = LoggerFactory.getLogger(SouthboundUtil.class);
+ private static final String SCHEMA_VERSION_MISMATCH =
+ "{} column for {} table is not supported by this version of the {} schema: {}";
private static InstanceIdentifierCodec instanceIdentifierCodec;
return String.valueOf(
connectionInfo.getRemoteIp().getValue()) + ":" + connectionInfo.getRemotePort().getValue();
}
+
+ public static void schemaMismatchLog(String column, String table, SchemaVersionMismatchException ex) {
+ LOG.debug(SCHEMA_VERSION_MISMATCH, column, table, SouthboundConstants.OPEN_V_SWITCH, ex.getMessage());
+ }
}
package org.opendaylight.ovsdb.southbound.ovsdb.transact;
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
import java.util.Collection;
import java.util.Map;
transaction.add(op.mutate(bridge).addMutation(bridge.getProtocolsColumn().getSchema(),
Mutator.DELETE,bridge.getProtocolsColumn().getData()));
} catch (SchemaVersionMismatchException e) {
- LOG.warn("protocol is not supported by this version of ovsdb", e);
+ schemaMismatchLog("protocols", "Bridge", e);
}
}
}
package org.opendaylight.ovsdb.southbound.ovsdb.transact;
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
import java.util.Collection;
import java.util.Map;
.where(bridge.getNameColumn().getSchema().opEqual(bridge.getNameColumn().getData()))
.build());
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.warn("protocol not supported by this version of ovsdb: {}", e.getMessage());
+ schemaMismatchLog("protocols", "Bridge", e);
}
}
}
package org.opendaylight.ovsdb.southbound.ovsdb.transact;
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
import java.util.Collection;
import java.util.Collections;
}
}
} catch (SchemaVersionMismatchException e) {
- LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema", e);
+ schemaMismatchLog("lldp", "Interface", e);
}
}
}
}
} catch (SchemaVersionMismatchException e) {
- LOG.debug("bfd column for Interface Table unsupported for this version of ovsdb schema", e);
+ schemaMismatchLog("bfd", "Interface", e);
}
}
package org.opendaylight.ovsdb.southbound.ovsdb.transact;
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
import java.util.Collection;
import java.util.HashMap;
}
}
} catch (SchemaVersionMismatchException e) {
- LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema", e);
+ schemaMismatchLog("lldp", "Interface", e);
}
}
}
}
} catch (SchemaVersionMismatchException e) {
- LOG.debug("bfd column for Interface Table unsupported for this version of ovsdb schema", e);
+ schemaMismatchLog("bfd", "Interface", e);
}
}
*/
package org.opendaylight.ovsdb.southbound.transactions.md;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
}
ovsdbNodeBuilder.setInterfaceTypeEntry(ifEntryList);
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("Iface types not supported by this version of ovsdb: {}", e.getMessage());
+ schemaMismatchLog("iface_types", SouthboundConstants.OPEN_V_SWITCH, e);
}
}
}
ovsdbNodeBuilder.setDatapathTypeEntry(dpEntryList);
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("Datapath types not supported by this version of ovsdb: {}", e.getMessage());
+ schemaMismatchLog("datapath_types", SouthboundConstants.OPEN_V_SWITCH, e);
}
}
package org.opendaylight.ovsdb.southbound.transactions.md;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
+
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.ArrayList;
}
}
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.warn("protocol not supported by this version of ovsdb: {}", e.getMessage());
+ schemaMismatchLog("protocols", "Bridge", e);
}
return result;
}
}
}
} catch (SchemaVersionMismatchException e) {
- LOG.debug("auto_attach column for Bridge Table unsupported for this version of ovsdb schema. {}", e);
+ schemaMismatchLog("auto_attach", "Bridge", e);
}
}
package org.opendaylight.ovsdb.southbound.transactions.md;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.opendaylight.ovsdb.southbound.SouthboundUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
ovsdbTerminationPointBuilder.setInterfaceLldp(interfaceLldpList);
}
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+ schemaMismatchLog("lldp", "Interface", e);
}
}
ovsdbTerminationPointBuilder.setInterfaceBfdStatus(interfaceBfdStatusList);
}
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("bfd-status column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+ schemaMismatchLog("bfd", "Interface", e);
}
}
ovsdbTerminationPointBuilder.setInterfaceBfd(interfaceBfdList);
}
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("bfd column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+ schemaMismatchLog("bfd", "Interface", e);
+
}
}