Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-105

Binding-aware code: adding two augmentations to a node does not work

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 4389

    Description

      When adding two augmentations to a node, data from the first augmentation does not get written to the data store.

      Consider the attached models and the following code:

      LOG.info("*** Writing a host node with TP");

      List<TerminationPoint> tpList7 = new ArrayList<TerminationPoint>();
      TpId tpId7 = new TpId("tp7");
      tpList.add(new TerminationPointBuilder()
      .setKey(new TerminationPointKey(tpId7))
      .setTpId(tpId7)
      .build());

      Node1 node1_7 = new Node1Builder()
      .setTerminationPoint(tpList7)
      .build();

      RemotePrefixKey ipPfxKey = new RemotePrefixKey(new IpPrefix("10.20.30.40/24".toCharArray()));
      RemotePrefix remotePrefix = new RemotePrefixBuilder()
      .setPrefix(ipPfxKey.getPrefix())
      .setKey(ipPfxKey)
      .build();

      List<RemotePrefix> pfxList = new ArrayList<RemotePrefix>();
      pfxList.add(remotePrefix);

      NodeAttributes attr7 = new TypeHostBuilder()
      .setRemotePrefix(pfxList)
      .build();

      Ofl3Node ofl3Node7 = new Ofl3NodeBuilder()
      .setNodeAttributes(attr7)
      .build();

      NodeKey key7 = new NodeKey(new NodeId("hostNode7"));
      Node node7 = new NodeBuilder()
      .setKey(key7)
      .addAugmentation(Node1.class, node1_7)
      .addAugmentation(Ofl3Node.class, ofl3Node7)
      .build();

      WriteTransaction tx7 = dataBroker.newWriteOnlyTransaction();
      InstanceIdentifier<Node> node_IID7 = NETWORK_IID.child(Node.class, key7);
      tx7.put(LogicalDatastoreType.CONFIGURATION, node_IID7, node7, true);

      try

      { tx7.submit().checkedGet(); }

      catch (TransactionCommitFailedException ex) {
      LOG.error("Transaction failed: {}", ex.toString());
      throw new RuntimeException(ex);
      }

      when looking at the data store through rest, i see the following data:

      {
      "network": [
      {
      "network-id": "test-network",
      "node": [
      {
      "node-id": "hostNode7",
      "ofl3-topology:remote-prefix": [

      { "prefix": "10.20.30.40/24" }

      ]
      }
      ]
      }
      ]
      }

      This problem appears in lithium

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ifoltin Igor Foltin
            jmedved@cisco.com Jan Medved
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: