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

Parent for presence node not initialized correctly #629

Closed
netwrkr95 opened this issue Nov 15, 2017 · 2 comments
Closed

Parent for presence node not initialized correctly #629

netwrkr95 opened this issue Nov 15, 2017 · 2 comments
Labels

Comments

@netwrkr95
Copy link

Expected Behavior

When a presence node is initialized the pointer to the parent node in the model should be automatically populated

Current Behavior

Traceback (most recent call last):
  File "./nc-create-xe-native-999-ipv6-vrf-def-ydk.py", line 108, in <module>
    crud.create(provider, native)
  File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 112, in helper
    return func(self, provider, entity, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/ydk/services/crud_service.py", line 30, in create
    return self._crud.create(provider, entity)
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
    _raise(_exc)
  File "/usr/local/lib/python2.7/dist-packages/ydk/errors/error_handler.py", line 56, in _raise
    raise exc
ydk.errors.YPYInvalidArgumentError:  ancestor for entity cannot be nullptr as one of the ancestors is a list. Path: ipv6

Steps to Reproduce

Your Script

def config_native(native):
    """Add config data to native object."""
    definition = native.vrf.Definition()
    definition.name = "test"
    definition.rd = "2:2"
    definition.description = "A YDK App added this IPv6 VRF Definition :-)  "

    # Address-Family Creation
    ipv6 = definition.address_family.Ipv6()
    ipv6.parent = definition.address_family

    export = ipv6.route_target.Export()
    export.asn_ip = "22:22"
    import_ = ipv6.route_target.Import_()
    import_.asn_ip = "22:22"

    ipv6.route_target.export.append(export)
    ipv6.route_target.import_.append(import_)

    definition.address_family.ipv6 = ipv6

    native.vrf.definition.append(definition)

System Information

ydk (0.6.1)
ydk-models-cisco-ios-xe (16.6.1.post1)
ydk-models-cisco-ios-xr (6.2.1)
ydk-models-ietf (0.1.4)
ydk-models-openconfig (0.1.4)
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial
@ghost ghost added the bug label Nov 16, 2017
@ghost
Copy link

ghost commented Feb 21, 2018

Unable to reproduce on ydk 0.7.0

~/>pip list|grep ydk
ydk                     0.7.0    
ydk-models-cisco-ios-xe 16.7.1  
...

@ghost ghost closed this as completed Feb 21, 2018
@ghost ghost reopened this Apr 3, 2018
@ghost
Copy link

ghost commented Apr 3, 2018

Able to reproduce:

def config_native(native):
    """Add config data to native object."""
    definition = native.vrf.Definition()
    definition.name = "test"
    definition.rd = "2:2"
    definition.description = "A YDK App added this IPv6 VRF Definition :-)  "

    # Address-Family Creation
    ipv6 = definition.address_family.Ipv6()

    export = ipv6.route_target.Export()
    export.asn_ip = "22:22"
    import_ = ipv6.route_target.Import()
    import_.asn_ip = "22:22"

    ipv6.route_target.export.append(export)
    ipv6.route_target.import_.append(import_)

    definition.address_family.ipv6 = ipv6

    native.vrf.definition.append(definition)

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