Fix for port-state Bug 262. 29/3929/2
authorEd Warnicke <eaw@cisco.com>
Thu, 26 Dec 2013 01:47:10 +0000 (17:47 -0800)
committerEd Warnicke <eaw@cisco.com>
Mon, 30 Dec 2013 22:43:50 +0000 (14:43 -0800)
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 <eaw@cisco.com>
opendaylight/md-sal/compatibility/inventory-topology-compatibility/src/main/java/org/opendaylight/controller/md/compatibility/switchmanager/CompatibleSwitchManager.xtend
opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang

index 430b5957efc1e3d4d9f707963871897b68341f54..62e767b8dab1e92194eaf3bb01e275f39054265e 100644 (file)
@@ -225,7 +225,7 @@ class CompatibleSwitchManager extends ConfigurableSwitchManager implements ISwit
         val ret = new HashSet<NodeConnector>();
         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));
             }
         }
index bc05894da82637cfae12f61257fc79bdd2609500..2554fffadb7a047d0e8bb525688a20ba1423ba13 100644 (file)
@@ -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 {