Updated port-types yang file to adhere to pyang validation. 33/4433/2
authorDeepthi V V <deepthi.v.v@ericsson.com>
Mon, 20 Jan 2014 10:39:54 +0000 (16:09 +0530)
committerDeepthi V V <deepthi.v.v@ericsson.com>
Mon, 20 Jan 2014 11:09:03 +0000 (11:09 +0000)
OF Plugin review: https://git.opendaylight.org/gerrit/#/c/4434/
Signed-off-by: Deepthi V V <deepthi.v.v@ericsson.com>
Change-Id: I4e1d0dd355864d7ed3f6f9ce4251d20db40a5a05

opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.xtend
opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang [moved from opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang with 92% similarity]

index 4378e7dffece701592936ce85dba77884c6ce8d8..a3be5dd970f775141ad5483ec7ebeb8260641ad9 100644 (file)
@@ -234,21 +234,21 @@ public class NodeMapping {
 
     public static def toAdBandwidth(PortFeatures pf) {
         var Bandwidth bw = null
-        if (pf.is_10mbHd || pf.is_10mbFd) {
+        if (pf.isTenMbHd || pf.isTenMbFd) {
             bw = new Bandwidth(Bandwidth.BW10Mbps)
-        } else if (pf.is_100mbHd || pf.is_100mbFd) {
+        } else if (pf.isHundredMbHd || pf.isHundredMbFd) {
             bw = new Bandwidth(Bandwidth.BW100Mbps)
-        } else if (pf.is_1gbHd || pf.is_1gbFd) {
+        } else if (pf.isOneGbHd || pf.isOneGbFd) {
             bw = new Bandwidth(Bandwidth.BW1Gbps)
-        } else if (pf.is_1gbFd) {
+        } else if (pf.isOneGbFd) {
             bw = new Bandwidth(Bandwidth.BW10Gbps)
-        } else if (pf.is_10gbFd) {
+        } else if (pf.isTenGbFd) {
             bw = new Bandwidth(Bandwidth.BW10Gbps)
-        } else if (pf.is_40gbFd) {
+        } else if (pf.isFortyGbFd) {
             bw = new Bandwidth(Bandwidth.BW40Gbps)
-        } else if (pf.is_100gbFd) {
+        } else if (pf.isHundredGbFd) {
             bw = new Bandwidth(Bandwidth.BW100Gbps)
-        } else if (pf.is_1tbFd) {
+        } else if (pf.isOneTbFd) {
             bw = new Bandwidth(Bandwidth.BW1Tbps)
         }
         return bw;
similarity index 92%
rename from opendaylight/md-sal/model/model-flow-base/src/main/yang/port-types.yang
rename to opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-port-types.yang
index 2554fffadb7a047d0e8bb525688a20ba1423ba13..f1cbd8dc29e7b2a5d0b29cef831c9c0068752a7d 100644 (file)
@@ -2,7 +2,6 @@ module opendaylight-port-types {
     namespace "urn:opendaylight:flow:types:port";
     prefix port-types;
 
-    import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}
     import opendaylight-queue-types {prefix queue-types; revision-date "2013-09-25";}
     
@@ -41,16 +40,16 @@ module opendaylight-port-types {
     
     typedef port-features {
         type bits {
-            bit 10mb-hd;
-            bit 10mb-fd;
-            bit 100mb-hd;
-            bit 100mb-fd;
-            bit 1gb-hd;
-            bit 1gb-fd;
-            bit 10gb-fd;
-            bit 40gb-fd;
-            bit 100gb-fd;
-            bit 1tb-fd;
+            bit ten-mb-hd;
+            bit ten-mb-fd;
+            bit hundred-mb-hd;
+            bit hundred-mb-fd;
+            bit one-gb-hd;
+            bit one-gb-fd;
+            bit ten-gb-fd;
+            bit forty-gb-fd;
+            bit hundred-gb-fd;
+            bit one-tb-fd;
             bit other;
             bit copper;
             bit fiber;
@@ -171,4 +170,4 @@ module opendaylight-port-types {
             }            
         }    
     }
-}
\ No newline at end of file
+}