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 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 {
index de61daeae3380f35fee50acf43aeebc766416c5c..92a2277b4c613abdf858ca28a3dbebb4c3a429f9 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()     
        }
     }