perlietf-netconf

"Net::Netconf::Manager" converts underscore in RPC request to hyphen


I am using Net::Netconf::Manager to query a device with RPC commands. In the RPC commands I should send a list of arguments, so I'm adding query arguments in a hash. One such argument is verbosity_level

Please note I am using underscore _ in this argument. When I print the hash, it is still underscore.

But when I print the XML RPC request that is sent to the device, the argument is changed to verbosity-level

<verbosity-level>abcd</verbosity-level>

instead of

<verbosity_level>abcd</verbosity_level>

So the device says it does not know such argument.

Why is the underscore gets converted to hyphen?


Solution

  • The code that does this is on line 492 of Net/Netconf/Device.pm. It's a simple substitution, and there's no comment to explain why it's there

    All I can think of to do is to comment out that line

    ($tag = $field) =~ s/_/-/g
    

    and replace it with

    $tag = $field
    

    which should get things going for you. In the mean time, you could perhaps email the Juniper Networks Perl Team at netconf-support@juniper.net and ask about it. If you do, please let us know the response