Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter data ignored in parent objects #455

Closed
111pontes opened this issue May 23, 2017 · 1 comment
Closed

Filter data ignored in parent objects #455

111pontes opened this issue May 23, 2017 · 1 comment
Labels

Comments

@111pontes
Copy link
Collaborator

In YDK-Py 0.5.4, filter data is ignored in parent objects. As an example, the following filter for the RIBv4 model (Cisco-IOS-XR-ip-rib-ipv4-oper) is expected to return some route leafs and some ipv4_rib_edm_path leafs:

def filter_rib(rib):
    vrf = rib.vrfs.Vrf()
    vrf.vrf_name = "RED"
    af = vrf.afs.Af()
    af.af_name = "IPv4"
    saf = af.safs.Saf()
    saf.saf_name = "Unicast"
    ip_rib_route_table_name = saf.ip_rib_route_table_names.IpRibRouteTableName()
    ip_rib_route_table_name.route_table_name = "default"
    route = ip_rib_route_table_name.routes.Route()
    route.address = READ()
    route.prefix_length = READ()
    route.protocol_name = READ()
    route.metric = READ()
    route.distance = READ()
    ipv4_rib_edm_path = route.route_path.Ipv4RibEdmPath()
    ipv4_rib_edm_path.address = READ()
    ipv4_rib_edm_path.interface_name = READ()
    route.route_path.ipv4_rib_edm_path.append(ipv4_rib_edm_path)
    ip_rib_route_table_name.routes.route.append(route)
    saf.ip_rib_route_table_names.ip_rib_route_table_name.append(ip_rib_route_table_name)
    af.safs.saf.append(saf)
    vrf.afs.af.append(af)
    rib.vrfs.vrf.append(vrf)

However, the encoded subtree filter only specifies the ipv4_rib_edm_path leafs:

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:65db977c-5f41-4187-8a25-3bad45d41907">
  <get>
    <filter type="subtree">
      <rib xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ip-rib-ipv4-oper">
        <vrfs>
          <vrf>
            <vrf-name>RED</vrf-name>
            <afs>
              <af>
                <af-name>IPv4</af-name>
                <safs>
                  <saf>
                    <saf-name>Unicast</saf-name>
                    <ip-rib-route-table-names>
                      <ip-rib-route-table-name>
                        <route-table-name>default</route-table-name>
                        <routes>
                          <route>
                            <route-path>
                              <ipv4-rib-edm-path>
                                <address/>
                                <interface-name/>
                              </ipv4-rib-edm-path>
                            </route-path>
                          </route>
                        </routes>
                      </ip-rib-route-table-name>
                    </ip-rib-route-table-names>
                  </saf>
                </safs>
              </af>
            </afs>
          </vrf>
        </vrfs>
      </rib>
    </filter>
  </get>
</rpc>
@ghost ghost added the bug label May 23, 2017
@ghost
Copy link

ghost commented Jun 6, 2017

Fixed by f8a3b9f

@ghost ghost closed this as completed Jun 6, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant