From: Ed Warnicke Date: Thu, 26 Dec 2013 01:47:10 +0000 (-0800) Subject: Fix for port-state Bug 262. X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-1~143^2~1 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=refs%2Fchanges%2F29%2F3929%2F2 Fix for port-state Bug 262. Changed from modeling port-state from an enum to a group of boolean leafs in a container. Change-Id: I532fff5806fd60823d47bdc255881b2f7ef6a76b Signed-off-by: Ed Warnicke --- diff --git a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend index 430b5957ef..62e767b8da 100644 --- a/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend +++ b/opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend @@ -225,7 +225,7 @@ class CompatibleSwitchManager extends ConfigurableSwitchManager implements ISwit val ret = new HashSet(); for (nc : data.nodeConnector) { val flowConn = nc.getAugmentation(FlowCapableNodeConnector); - if (flowConn != null && flowConn.state == PortState.Live) { + if (flowConn != null && flowConn.state != null && !flowConn.state.linkDown) { ret.add(new NodeConnector(MD_SAL_TYPE, nc.key, node)); } } diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang index bc05894da8..2554fffadb 100644 --- a/opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang +++ b/opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang @@ -27,11 +27,15 @@ module opendaylight-port-types { } } - typedef port-state { - type enumeration { - enum link-down; - enum blocked; - enum live; + grouping port-state { + leaf link-down { + type boolean; + } + leaf blocked { + type boolean; + } + leaf live { + type boolean; } } @@ -103,9 +107,9 @@ module opendaylight-port-types { description "Human readable name of the port"; } - leaf state { - type port-state; - description "Bit map of OFPPS-* flags"; + container state { + uses port-state; + description "Description of state of port"; } leaf current-feature {