cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1223
Views
0
Helpful
5
Replies

template tags

erdemk
Level 1
Level 1


Dear community,

I have a question please ..
Development manual : A tag in inherited to its sub-nodes until a new tag is introduced.
My question is : given the above fact, i was expecting the 2 outputs below to be the same and as the second one. What am i missing here ? 

I have a simple service, which manages device configs..

This is from my service template :

<config-template xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>{device}</name>
<config tags="merge">
<sysname xmlns="http://tail-f.com/ned/huawei-vrp">Huawei-CORE-SW-1</sysname>
<info-center xmlns="http://tail-f.com/ned/huawei-vrp">
<filter-id tags="merge">
<bymodule-alias>
<name>VTY</name>
<alias>ACL_DENY</alias>
</bymodule-alias>
</filter-id>
<source>
...

This is from "show full-config devices device Huawei-CORE-SW-1" output :
config
info-center filter-id bymodule-alias BFD ADDRCV_ERR
info-center filter-id bymodule-alias GVRP GVRPENABLE
info-center filter-id bymodule-alias VTY ACL_DENY


Below are the outputs for "service_for_device_config_compliance{Huawei-CORE-SW-1} commit dry-run" with different template tags :
1)
<config tags="replace">
<filter-id tags="merge">
output same also for :
<config tags="replace">
<info-center xmlns="http://tail-f.com/ned/huawei-vrp" tags="merge">

cli {
local-node {
data devices {
device Huawei-CORE-SW-1 {
config {
info-center {
filter-id {
- bymodule-alias BFD ADDRCV_ERR {
- }
- bymodule-alias GVRP GVRPENABLE {
- }
}
}

2)
<config tags="merge">
<filter-id tags="merge">
cli {
local-node {
data devices {
device Huawei-CORE-SW-1 {
config {
telnet { --> this means there is no output for info-center
server {
+ enable true;
}
}

nso ver : 5.3
huawei NED : huawei-vrp-cli-6.3

 

Thanks and regards,

 

1 Accepted Solution

Accepted Solutions

No, you have already replaced the entire contents of config before you get to that point, so there is nothing left to merge with.

I mean, you could argue that the behavior you describe would be better of course!

View solution in original post

5 Replies 5

erdemk
Level 1
Level 1

May this be a bug ?

Any comment is appreciated ..

I think it is just that replace is a very aggressive tag. Putting replace on config will delete all of your current contents in config and replace it with what is in template.

That seems consistent with what you see? But it also means that having replace at any level essentially means having it at all lower layers.

erdemk
Level 1
Level 1

Viktor hi,

Thanks for your reply..

 

I understand that replace is an aggressive tag. And also having replace tag at any level will effect all lower layers. 

 

My question is , Given the statement : "Development manual : A tag in inherited to its sub-nodes until a new tag is introduced.", when we place a different tag ( merge in our example ) at a lower layer compared to "replace" tag, wouldn't this tag (merge) be in effect at this layer and lower layers under this (merge) tagged layer.

 

Example in our scenario :

 

Comparing 1 and 2 above, both have "merge" at lower layer, and 1 have "replace" ,  2 have "merge" at higher layer. And config for which template is applied is under lower layer. 

 

i was expecting both 1 and 2 yield same result, as "merge" is closer to config leafs. In other words,  having merge tag under replace tag doesn't seem to have any effect.

 

Thanks and regards.

 

No, you have already replaced the entire contents of config before you get to that point, so there is nothing left to merge with.

I mean, you could argue that the behavior you describe would be better of course!

Understood.

Thank you.