BUG-1717 Rename duplicate node(bgp-id) from config yang for bgp-rib-impl 95/10895/3
authorMaros Marsalek <mmarsale@cisco.com>
Mon, 8 Sep 2014 08:48:32 +0000 (10:48 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 8 Sep 2014 11:18:18 +0000 (13:18 +0200)
Change-Id: I0443cb684fccaf76dcf56bd9abd67e6f52e54c29
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
bgp/controller-config/src/main/resources/initial/41-bgp-example.xml
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/BGPApplicationPeerModule.java
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/RIBImplModule.java
bgp/rib-impl/src/main/yang/odl-bgp-rib-impl-cfg.yang
bgp/rib-impl/src/test/java/org/opendaylight/controller/config/yang/bgp/rib/impl/AbstractRIBImplModuleTest.java
bgp/rib-impl/src/test/java/org/opendaylight/controller/config/yang/bgp/rib/impl/BGPApplicationPeerModuleTest.java
bgp/rib-impl/src/test/java/org/opendaylight/controller/config/yang/bgp/rib/impl/RIBImplModuleTest.java

index d4fcc5dd6d5370ee5a706f5d24b2eee76218d5e7..3675e4da17ff9151cf9b7dfdcaf035691ce87821 100644 (file)
@@ -99,7 +99,7 @@
                     <name>example-bgp-rib</name>
                     <rib-id>example-bgp-rib</rib-id>
                     <local-as>64496</local-as>
-                    <bgp-id>192.0.2.2</bgp-id>
+                    <bgp-rib-id>192.0.2.2</bgp-rib-id>
                     <local-table>
                         <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
                         <name>ipv4-unicast</name>
index 6b3b28db824a907b6b83173a1c52418d43e255eb..f40e3c444ca6aa1333f713da1976d775905a0c25 100644 (file)
@@ -35,7 +35,7 @@ public class BGPApplicationPeerModule extends org.opendaylight.controller.config
     @Override
     public java.lang.AutoCloseable createInstance() {
         final InstanceIdentifier<?> id = InstanceIdentifier.builder(ApplicationRib.class, new ApplicationRibKey(getApplicationRibId())).build();
-        final ApplicationPeer peer = new ApplicationPeer(getApplicationRibId(), getBgpId(), (RIBImpl) getTargetRibDependency());
+        final ApplicationPeer peer = new ApplicationPeer(getApplicationRibId(), getBgpPeerId(), (RIBImpl) getTargetRibDependency());
         return getDataBrokerDependency().registerDataChangeListener(LogicalDatastoreType.CONFIGURATION, id, peer, DataChangeScope.SUBTREE);
     }
 
index 6d2bbe4ae938bbfe86da52241c6bc0ccfe89bbc5..1500453a0a30799eb9c14e1b2f2733fdb070c6a2 100644 (file)
@@ -43,7 +43,7 @@ public final class RIBImplModule extends org.opendaylight.controller.config.yang
         JmxAttributeValidationException.checkNotNull(getExtensions(), IS_NOT_SET, extensionsJmxAttribute);
         JmxAttributeValidationException.checkNotNull(getRibId(), IS_NOT_SET, ribIdJmxAttribute);
         JmxAttributeValidationException.checkNotNull(getLocalAs(), IS_NOT_SET, localAsJmxAttribute);
-        JmxAttributeValidationException.checkNotNull(getBgpId(), IS_NOT_SET, bgpIdJmxAttribute);
+        JmxAttributeValidationException.checkNotNull(getBgpRibId(), IS_NOT_SET, bgpRibIdJmxAttribute);
         JmxAttributeValidationException.checkNotNull(getTcpReconnectStrategy(), IS_NOT_SET, tcpReconnectStrategyJmxAttribute);
         JmxAttributeValidationException.checkNotNull(getSessionReconnectStrategy(), IS_NOT_SET, sessionReconnectStrategyJmxAttribute);
         JmxAttributeValidationException.checkNotNull(getLocalTable(), IS_NOT_SET, localTableJmxAttribute);
@@ -51,6 +51,6 @@ public final class RIBImplModule extends org.opendaylight.controller.config.yang
 
     @Override
     public java.lang.AutoCloseable createInstance() {
-        return new RIBImpl(getRibId(), new AsNumber(getLocalAs()), getBgpId(), getExtensionsDependency(), getBgpDispatcherDependency(), getTcpReconnectStrategyDependency(), getSessionReconnectStrategyDependency(), getDataProviderDependency(), getLocalTableDependency());
+        return new RIBImpl(getRibId(), new AsNumber(getLocalAs()), getBgpRibId(), getExtensionsDependency(), getBgpDispatcherDependency(), getTcpReconnectStrategyDependency(), getSessionReconnectStrategyDependency(), getDataProviderDependency(), getLocalTableDependency());
     }
 }
index 1f05ccc70a30f8e4ccac9ac2406b3d4e712f74f5..22991f173f41be60cd974eee561f9cb664ad1cf9 100644 (file)
@@ -246,7 +246,7 @@ module odl-bgp-rib-impl-cfg {
                 mandatory true;
             }
 
-            leaf bgp-id {
+            leaf bgp-peer-id {
                 type inet:ipv4-address;
                 mandatory true;
             }
@@ -422,7 +422,7 @@ module odl-bgp-rib-impl-cfg {
                 mandatory true;
             }
 
-            leaf bgp-id {
+            leaf bgp-rib-id {
                 description "Our local BGP identifier. Needed by best selection path attribute.";
                 mandatory true;
                 type inet:ipv4-address;
index 714c8b75fa219238cc3863c34e4d63ae1fedf737..db073b7ee0d5be54d950f155e439fee8db5c65ac 100644 (file)
@@ -236,7 +236,7 @@ public abstract class AbstractRIBImplModuleTest extends AbstractConfigTest {
         mxBean.setExtensions(createRibExtensionsInstance(transaction));
         mxBean.setRibId(ribId);
         mxBean.setLocalAs(localAs);
-        mxBean.setBgpId(bgpId);
+        mxBean.setBgpRibId(bgpId);
         return nameCreated;
     }
 
index d133dba08a4c899c58dd48dfb2d9fedcd6eea303..7d5a886af4c5b0858b2daaf6ca247cf9c28298de 100644 (file)
@@ -70,7 +70,7 @@ public class BGPApplicationPeerModuleTest extends AbstractRIBImplModuleTest {
         final BGPApplicationPeerModuleMXBean mxBean = transaction.newMXBeanProxy(objName, BGPApplicationPeerModuleMXBean.class);
         final ObjectName dataBrokerON = createAsyncDataBrokerInstance(transaction);
         mxBean.setDataBroker(dataBrokerON);
-        mxBean.setBgpId(BGP_ID);
+        mxBean.setBgpPeerId(BGP_ID);
         mxBean.setApplicationRibId(APP_RIB_ID);
         mxBean.setTargetRib(createRIBImplModuleInstance(transaction, dataBrokerON));
         return transaction.commit();
index fe7764733f117cba2b64b1d1f0de41789a10e0d5..71185901e16b081ea3d943abc2b9966a60a6f6ef 100644 (file)
@@ -45,7 +45,7 @@ public class RIBImplModuleTest extends AbstractRIBImplModuleTest {
             createRIBImplModuleInstance(RIB_ID, 500L, null);
             fail();
         } catch (final ValidationException e) {
-            assertTrue(e.getMessage().contains("BgpId is not set."));
+            assertTrue(e.getMessage().contains("BgpRibId is not set."));
         }
     }