i want to use netopeer cli to edit ietf-system parameters

872 views
Skip to first unread message

Rod

unread,
Dec 10, 2014, 4:30:50 PM12/10/14
to neto...@googlegroups.com
i am using netopeer (which i pulled down on  Nov 14, 2014) in uuntu 14.04 virtualbox VM.

i have netopeer using multilevel server to talk to ietf-system.
RPCs work correctly.

cli status shows that i am connected correctly to ietf-system.

i want to edit-config on running database timezone, but i get this error:

edit-config

  Select target datastore (running|startup|candidate|url:<dsturl>): running
  Type the edit configuration data (close editor by Ctrl-D):
  <clock>
      <timezone-name>PST</timezone-name>
    </clock>
  ^d
NETCONF error: operation-failed (application) - There is no device/data that could be affected.

server console shows:
netopeer-server[2968]: New agent ID set to :1.41.
netopeer-server[2968]: Some message received
netopeer-server[2968]: Request <?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <get-config>
    <source>
      <running/>
    </source>
  </get-config>
</rpc>
netopeer-server[2968]: Some message received
netopeer-server[2968]: Request <?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <clock>
        <timezone-name>PST</timezone-name>
      </clock>
    </config>
  </edit-config>
</rpc>

 i assume i'm not entering correct xml to specify namespace and timezone param.  

can someone show me what is correct form for editing various parameters in ietf-system?

thanks,
Rod

Michal Vasko

unread,
Dec 11, 2014, 2:22:24 AM12/11/14
to neto...@googlegroups.com
Hi Rod,

you can always read the correct XML structure from the data model or from the get-config running command. If you notice, the container "clock" is in another one, the root one, "system". So every time you want to edit something in cfgsystem configuration, you must start with the root. That is what the server is trying to tell you, there is no device/data with the root "clock". Then obviously, the correct PRC content would be:

<system>

  <clock>
    <timezone-name>PST</timezone-name>
  </clock>
</system>

Regards,
Michal

Radek Krejčí

unread,
Dec 11, 2014, 2:29:35 AM12/11/14
to Michal Vasko, awardsolu...@gmail.com, neto...@googlegroups.com
Hi,

this isn't correct. Michal is missing the namespace in the <system>
element. It should be

<system xmlns="urn:ietf:params:xml:ns:yang:ietf-system">
<clock>
<timezone-name>PST</timezone-name>
</clock>
</system>

Regards,
Radek


Dne 11.12.2014 v 08:22 Michal Vasko napsal(a):

Rod

unread,
Dec 15, 2014, 5:06:28 PM12/15/14
to neto...@googlegroups.com
OK, I can use cli to edit timezone on ietf-system.  but still have question.
i used copy-config to copy startup into candidate, then edit candidate to invalid timezone,
then do validate and it does not detect the error.  when i do commit, system does find
error.  My question is should validate have detected the error or am i not understanding 
the function of validate?


netconf> edit-config 

  Select target datastore (running|startup|candidate|url:<dsturl>): candidate

  Type the edit configuration data (close editor by Ctrl-D):
<system xmlns="urn:ietf:params:xml:ns:yang:ietf-system">
  <clock>
    <timezone-name>America/New_Yorc</timezone-name>   << this is the error, it should be America/New_York
  </clock>
</system>


  Result OK
netconf> validate 

  Select source datastore (running|startup|candidate|url:<dsturl>): candidate

  Result OK  << ?? should validate have detected the error?
 
netconf> commit
NETCONF error: operation-failed (application) - Setting timezone failed - unable to get info about "/usr/share/zoneinfo/America/New_Yorc" file (No such file or directory).
NETCONF error: operation-failed (application) - Failed to apply configuration changes to device.
netconf> 

server logs:
netopeer-server[3522]: RelaxNG validation on subdatastore 1681692778
netopeer-server[3522]: Schematron validation on subdatastore 1681692778

Michal Vasko

unread,
Dec 16, 2014, 7:16:44 AM12/16/14
to neto...@googlegroups.com
Hi Rod,

validation is performed by comparing the datastore to the model. When you look into the model, timezone-name is defined simply as a string and that is satisfied in your case. The problem can be found only by actually checking whether the file of that timezone exists, which is done no sooner than when applying the configuration.

Regards,
Michal

PS: Sorry about my mistake before.
Reply all
Reply to author
Forward
0 new messages