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

Invalid leaf names do not trigger a YDK exception #815

Closed
djsmith20171 opened this issue Aug 28, 2018 · 1 comment
Closed

Invalid leaf names do not trigger a YDK exception #815

djsmith20171 opened this issue Aug 28, 2018 · 1 comment
Projects

Comments

@djsmith20171
Copy link

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

Expected Behavior

We expect YDK exception for invalid leaf names.

Current Behavior

Python programs runs successfully without exceptions - which is incorrect. Invalid leaf is silently ignored during XML encoding.

Steps to Reproduce

Easy to reproduce by mistyping a leaf name.

Your Script

from argparse import ArgumentParser
import urllib.parse
# from urlparse import urlparse

from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
from ydk.models.cisco_ios_xr import Cisco_IOS_XR_mpls_lsd_cfg \
    as xr_mpls_lsd_cfg
from ydk.types import Empty
import logging


def config_mpls_lsd(mpls_lsd):
    """Add config data to mpls_lsd object."""
    mpls_lsd.mpls_ip_ttl_propagate_disable = xr_mpls_lsd_cfg.MplsIpTtlPropagateDisable.all
    # mpls_lsd.app_reg_delay_disable = Empty()
 
    # Line below uses incorrect leaf name (agg_reg_delay_disable) instead of 
    # the correct leaf name above (app_reg_delay_disable).  No exception is generated when the
    # object is encoded.  
    mpls_lsd.agg_reg_delay_disable = Empty()
    mpls_lsd.ltrace_multiplier = 2
    mpls_lsd.mpls_entropy_label = Empty()

Logs

Enable logging and post the logs below

<mpls-lsd xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-mpls-lsd-cfg" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
  <ltrace-multiplier>2</ltrace-multiplier>
  <mpls-entropy-label/>
</mpls-lsd>

System Information

admin@controller:md-sdk$ pip list | grep ydk
ydk                     0.7.1
ydk-models-cisco-ios-xr 6.3.2
ydk-models-ietf         0.1.5
@111pontes 111pontes added the bug label Aug 28, 2018
@ghost ghost added the python label Aug 30, 2018
@ghost ghost added this to In progress in YDK Sep 10, 2018
@ghost
Copy link

ghost commented Sep 15, 2018

Fixed in #820

@ghost ghost closed this as completed Sep 15, 2018
YDK automation moved this from In progress to Done Sep 15, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
YDK
  
Done
Development

No branches or pull requests

2 participants