Log enhancements for better debuggability
[genius.git] / interfacemanager / interfacemanager-impl / src / main / java / org / opendaylight / genius / interfacemanager / renderer / ovs / statehelpers / OvsInterfaceStateUpdateHelper.java
index 5972a12f93f236c703b7858fc9ecafb8229b8ccf..ce2a8725ff9b7976e78c8e2f55ff5903c6843786 100644 (file)
@@ -35,13 +35,13 @@ public class OvsInterfaceStateUpdateHelper {
             AlivenessMonitorService alivenessMonitorService, DataBroker dataBroker, String interfaceName,
             FlowCapableNodeConnector flowCapableNodeConnectorNew,
             FlowCapableNodeConnector flowCapableNodeConnectorOld) {
-        LOG.debug("Update of Interface State for port: {}", interfaceName);
+        LOG.debug("Updating interface state information for interface: {}", interfaceName);
         List<ListenableFuture<Void>> futures = new ArrayList<>();
 
-        Interface.OperStatus operStatusNew = getOpState(flowCapableNodeConnectorNew);
+        Interface.OperStatus operStatusNew = InterfaceManagerCommonUtils.getOpState(flowCapableNodeConnectorNew);
         MacAddress macAddressNew = flowCapableNodeConnectorNew.getHardwareAddress();
 
-        Interface.OperStatus operStatusOld = getOpState(flowCapableNodeConnectorOld);
+        Interface.OperStatus operStatusOld = InterfaceManagerCommonUtils.getOpState(flowCapableNodeConnectorOld);
         MacAddress macAddressOld = flowCapableNodeConnectorOld.getHardwareAddress();
 
         boolean opstateModified = false;
@@ -110,13 +110,6 @@ public class OvsInterfaceStateUpdateHelper {
         }
     }
 
-    public static Interface.OperStatus getOpState(FlowCapableNodeConnector flowCapableNodeConnector) {
-        Interface.OperStatus operStatus = flowCapableNodeConnector.getState().isLive()
-                && !flowCapableNodeConnector.getConfiguration().isPORTDOWN() ? Interface.OperStatus.Up
-                        : Interface.OperStatus.Down;
-        return operStatus;
-    }
-
     public static void handleInterfaceStateUpdates(
             org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
                 .ietf.interfaces.rev140508.interfaces.Interface iface,