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

Cisco-IOS-XR-ipv6-smiap-cfg module: Mandatory leaf missing from request but getting the leaf configuration #598

Closed
tthouhid opened this issue Oct 11, 2017 · 1 comment
Labels

Comments

@tthouhid
Copy link

tthouhid commented Oct 11, 2017

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

Expected Behavior

The configurations for IPv6-smiap virtual address for management interfaces we should get the RPC reply as ok

Current Behavior

No ok in reply received from device. (RPC reply as mandatory leaf missing from request)

  <bad-element>address</bad-element>
  <error-message>mandatory leaf missing from request, please add it and try again.</error-message>

Steps to Reproduce

Configure IPv6 virtual address for the management interfaces.
Getting RPC error as "mandatory leaf missing from request"

Your Script

    class cisco_xr_ipv6_smiap():
    def create_ipv6_smiap_config(self, crud_service, provider):
        obj_smiap = ipv6_smiap_cfg.Ipv6Virtual()
        obj_smiap.use_as_source_address = Empty()
        obj_vrf = obj_smiap.Vrfs.Vrf() 
        obj_vrf.vrf_name = "default"
        obj_address = obj_vrf.Address()
        obj_vrf.address = obj_address
        obj_address.address = "0020:0000:0000:0000:0000:0000:0000:0001"
        obj_address.prefix_length = 128
        obj_smiap.vrfs.vrf.append(obj_vrf)
        crud_service.create(provider, obj_smiap)

Logs

Enable logging and post the logs below

=============Reply payload received from device=============
<?xml version="1.0"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <rpc-error>
    <error-type>protocol</error-type>
    <error-tag>missing-element</error-tag>
    <error-severity>error</error-severity>
    <error-path xmlns:ns1="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv6-smiap-cfg">ns1:ipv6-virtual/ns1:vrfs/ns1:vrf[vrf-name = 'default']/ns1:address/ns1:address</error-path>
    <error-info>
      <bad-element>address</bad-element>
      <error-message>mandatory leaf missing from request, please add it and try again.</error-message>
    </error-info>
  </rpc-error>
</rpc-reply>

System Information

Python Version 2.7
Route Operating System: CISCO-IOS-XR
ipv6_smiap.log

@ghost ghost added the bug label Oct 12, 2017
@ghost
Copy link

ghost commented Oct 12, 2017

This has been fixed in the latest ydk-gen master branch. Now, the correct payload is produced:

<?xml version="1.0"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <edit-config>
    <target>
      <candidate/>
    </target>
    <error-option>rollback-on-error</error-option>
    <config>
      <ipv6-virtual xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv6-smiap-cfg" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="merge">
        <use-as-source-address/>
        <vrfs>
          <vrf>
            <vrf-name>default</vrf-name>
            <address>
              <prefix-length>128</prefix-length>
              <address>0020:0000:0000:0000:0000:0000:0000:0001</address>
            </address>
          </vrf>
        </vrfs>
      </ipv6-virtual>
    </config>
  </edit-config>
</rpc>

In the next release of YDK, they will be packaged into libydk and ydk-py.
In the meanwhile, you can always use the steps in the ydk-gen README to generate/install libydk, python core and bundles containing these fixes:

  1. https://github.com/CiscoDevNet/ydk-gen#installation
  2. https://github.com/CiscoDevNet/ydk-gen#second-step-generate--install-the-core

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