Skip to content

YFilter dropped when used with NetconfService and EntityCollection #803

Closed
@ghost

Description

Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.

Expected Behavior

From: https://communities.cisco.com/thread/92597
Below 2 scripts should produce same payloads.

Current Behavior

from ydk.models.cisco_ios_xr import Cisco_IOS_XR_ipv4_ospf_cfg
from ydk.filters import YFilter  
from ydk.services import NetconfService                       
from ydk.services import Datastore
from ydk.providers import NetconfServiceProvider    

os=Cisco_IOS_XR_ipv4_ospf_cfg.Ospf()
os.yfilter = YFilter.create
                                
n = NetconfService()
provider = NetconfServiceProvider(address='<ip-addr>' , username='<>', password='<>')

With the above object, below 2 scripts are producing different payloads

Your Script

n.edit_config(provider,Datastore.running,[os])

produces below xml

  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg"/>
    </config>
  </edit-config>
</rpc>
n.edit_config(provider,Datastore.running,os)

produces below xml

  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <ospf xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-ospf-cfg" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="create"/>
    </config>
  </edit-config>

System Information

ydk 0.7.2-dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions