X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fweb%2Fdevices%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fdevices%2Fweb%2FDevices.java;fp=opendaylight%2Fweb%2Fdevices%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fdevices%2Fweb%2FDevices.java;h=e4bb790676379bfb508ea6b6eec4051a38286636;hp=a118ccfbba70658fd4e2c817ea5a9e60bce7b500;hb=78405e6699eb9c85e8b0c3e2fd85a798f0bcbd55;hpb=3037a8b4158f8e4dbb891047180c5b1a9a0e053b diff --git a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java index a118ccfbba..e4bb790676 100644 --- a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java +++ b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java @@ -23,7 +23,6 @@ import java.util.concurrent.ConcurrentMap; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.fasterxml.jackson.databind.ObjectMapper; import org.opendaylight.controller.connectionmanager.IConnectionManager; import org.opendaylight.controller.forwarding.staticrouting.IForwardingStaticRouting; import org.opendaylight.controller.forwarding.staticrouting.StaticRouteConfig; @@ -60,6 +59,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -145,21 +145,21 @@ public class Devices implements IDaylightWeb { for (NodeConnector nodeConnector : nodeConnectorSet) { String nodeConnectorNumberToStr = nodeConnector.getID().toString(); Name ncName = ((Name) switchManager.getNodeConnectorProp(nodeConnector, Name.NamePropName)); - Config portStatus = ((Config) switchManager.getNodeConnectorProp(nodeConnector, + Config portConfig = ((Config) switchManager.getNodeConnectorProp(nodeConnector, Config.ConfigPropName)); State portState = ((State) switchManager.getNodeConnectorProp(nodeConnector, State.StatePropName)); String nodeConnectorName = (ncName != null) ? ncName.getValue() : ""; nodeConnectorName += " (" + nodeConnector.getID() + ")"; - if (portStatus != null) { - if (portStatus.getValue() == Config.ADMIN_UP) { - if (portState.getValue() == State.EDGE_UP) { + if (portConfig != null) { + if (portConfig.getValue() == Config.ADMIN_UP) { + if (portState != null && portState.getValue() == State.EDGE_UP) { nodeConnectorName = "" + nodeConnectorName + ""; - } else if (portState.getValue() == State.EDGE_DOWN) { + } else if (portState == null || portState.getValue() == State.EDGE_DOWN) { nodeConnectorName = "" + nodeConnectorName + ""; } - } else if (portStatus.getValue() == Config.ADMIN_DOWN) { + } else if (portConfig.getValue() == Config.ADMIN_DOWN) { nodeConnectorName = "" + nodeConnectorName + ""; } }