From 409a1a2f2ce689de27b76b779b7ce2d2ba216426 Mon Sep 17 00:00:00 2001 From: Ed Warnicke Date: Wed, 25 Dec 2013 17:47:10 -0800 Subject: [PATCH] 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 --- .../CompatibleSwitchManager.xtend | 2 +- .../src/main/yang/port-types.yang | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) 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 { -- 2.36.6