Merge changes Ib1fb74f6,I532fff58
authorAlessandro Boch <aboch@cisco.com>
Fri, 3 Jan 2014 18:06:15 +0000 (18:06 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 3 Jan 2014 18:06:15 +0000 (18:06 +0000)
* changes:
  Remove links from topology when port goes down
  Fix for port-state Bug 262.

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
opendaylight/md-sal/topology-manager/src/main/java/org/opendaylight/md/controller/topology/manager/FlowCapableTopologyExporter.xtend

index 430b595..62e767b 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 bc05894..2554fff 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 {
index de61dae..92a2277 100644 (file)
@@ -95,6 +95,9 @@ OpendaylightInventoryListener //
     
             val it = dataService.beginTransaction
             putOperationalData(path, point);
+            if((fcncu.state != null && fcncu.state.linkDown) || (fcncu.configuration != null && fcncu.configuration.PORTDOWN)) {
+                removeAffectedLinks(it,point.tpId)
+            }
             commit()     
        }
     }