cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
614
Views
0
Helpful
6
Replies

Access to service value from Python

Noel Cantenot
Level 1
Level 1

Hello,

with the following yang, I defined a device with a list of vlans (id, ip_add and description).

 

  augment /ncs:services {
    list rfs_router_intf {
      tailf:info "RFS interfaces vlan";
      key rfs_name;

      leaf rfs_name {
          type string;
      }

      uses ncs:service-data;
      ncs:servicepoint "rfs-router-intf";

      leaf rfs_device_name {
          type leafref {
          tailf:info "________ Nom du switch";
          path "/ncs:devices/ncs:device/ncs:name";
          }
      }
      
      list rfs_vlan {
        key rfs_vlan_id;
        tailf:info "Liste des devices";
        unique "rfs_ip_add";

        leaf rfs_vlan_id {
        tailf:info "________ Vlan number";
        type uint32;
        }
        
        leaf rfs_ip_add {
        tailf:info "________ adresse IP";
        type string;
        }

        leaf rfs_description {
        tailf:info "________ Description";
        type string;
        }
      }
    }

 


I want to customize the description using Python. I tried to loop wihtin Python, but only the last description was applied to all vlans.

 

        for vlan in service.rfs_vlan:
            desc = vlan.rfs_description
            vars.add('DESCRIPTION', 'NSO - RFS - ' + str(desc))
            template.apply('rfs-router-intf-template', vars)

 

Actually, I think that every vars.add("DESCRIPTION",..) was overwriting the previous one.

So I tried to loop in the template as follow:

 

<config-template xmlns="http://tail-f.com/ns/config/1.0"> <!-- Pas de servicepoint, sinon il override celui du Python, et le python n'est pas exécuté -->
  <devices xmlns="http://tail-f.com/ns/ncs">
    <device tags="merge">
      <name>{rfs_device_name}</name>
      <config>
        <?foreach {/rfs_vlan}?>
                   <interface xmlns="http://tail-f.com/ned/cisco-nx">
                     <Vlan>
                       <name>{rfs_vlan_id}</name>
                       <!--  <description>{rfs_description}</description>  -->
                       <description>{$DESCRIPTION}}</description>
                       <ip>
                          <address>
                            <ipaddr>{rfs_ip_add}</ipaddr>
                          </address>
                       </ip>
                     </Vlan>
                   </interface>
        <?end?>
      </config>
    </device>
  </devices>
</config-template>

 


The thing is I don't know how to access to the description in Python to modify it !!
As service is supposed to be a list, I tried several things, but none work.

 

 

    @service.create
    def cb_create(self, tctx, root, service, proplist):
        self.log.info('Service create(service=', service._path, ')')
        
        template = ncs.template.Template(service)
        vars = ncs.template.Variables()

	# tested, but failed
        #desc = service.rfs_vlan[0] 
        #desc = service.rfs_vlan["rfs_description"]
        #desc = service["rfs-router-intf"]["rfs_vlan"]

        vars.add('DESCRIPTION', 'NSO - RFS - ' + str(desc))

        template.apply('rfs-router-intf-template', vars)

 

What to I miss ?

 

1 Accepted Solution

Accepted Solutions

mfr-6
Spotlight
Spotlight

hi @Noel Cantenot 

Based on the "debug template" output, seems like NSO evaluates the template in a specific way. If you use values from nodes, then the template is evaluated in a single shot and it contains all yang node values referred multiple times. But since you loop over vlans in Python script, template is applied two times.
Let's see how the first iteration looks like:
Loop:

 

 

       for vlan in service.rfs_vlan:
            desc = vlan.rfs_description
            vars.add('DESCRIPTION', 'NSO - RFS - ' + str(desc))
            self.log.info(f"vars: {vars}")
            template.apply('rfs-router-intf-template', vars)

 

 

Under first iteration in Python script, under "vlan" variable in loop, you'll have "10". Just before your loop will go to the next element, the template is applied using "template.apply" method. This results in debug message that looks as follows:

 

 

Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result: "NSO - RFS - vlan 10" #### THIS SHOWS US THAT /VLAN/ IS EVALUATED TO 10 ####
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description to "NSO - RFS - vlan 10"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10.1.1.1/24"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr to "10.1.1.1/24"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']
Result: "NSO - RFS - vlan 10" #### THIS SHOWS US THAT /VLAN/ IS EVALUATED TO 10 ####

 

 

 In the first iteration - DESCRIPTION becomes to be "NSO - RFS - vlan 10". But the interesting thing is that when you apply the template and use yang nodes directly, not through python vars - multiple values are applied at once!

In the second iteration, under "vlan" loop var, we will have "20". You can also see that multiple values from yang nodes are applied AGAIN at once, but this time, we have a difference in DESCRIPTION, because for this iteration it evaluates to "NSO - RFS - vlan20" which affects all vlan interfaces. You can also see messages like "Operation 'merge' on existing node" which tell us that we are applying the same things again. Since in the second iteration vlan id equals to 20 - DESCRIPTION is different and it is applied for ALL elements. That's why you see DESCRIPTION with vlan20 for both elements.

I think you should stick to Python vars and pass everything to template as a Python vars. This will solve your issue and help you avoid unexpected behaviors like this.

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!

View solution in original post

6 Replies 6

mfr-6
Spotlight
Spotlight

hi @Noel Cantenot 
I see duplicated closing brackets here:

 

                       <description>{$DESCRIPTION}}</description>

 

Before adding variable to the template, you can troubleshoot if changes have been applied to the value as expected simply by using logger

 

        for vlan in service.rfs_vlan:
            desc = vlan.rfs_description
            vars.add('DESCRIPTION', 'NSO - RFS - ' + str(desc))
            self.log.info(f"vars: {vars}")
            template.apply('rfs-router-intf-template', vars)

 

You can see log messages saved in python-vm.log.

Actually, I think that every vars.add("DESCRIPTION",..) was overwriting the previous one.

That sounds like iterating through elements in list doesn't work properly. I'd try to make rfs_vlan_id and rfs_ip_addr to be passed in the same way as it is now with description to the template and read from python instead of model directly ( {$VARNAME} ) without loop in template.

        for vlan in service.rfs_vlan:
            desc = vlan.rfs_description
            vars.add('DESCRIPTION', 'NSO - RFS - ' + str(desc))
            vars.add('VLAN_ID', vlan.rfs_vlan_id)
            vars.add('IP_ADDR', vlan.rfs_ip_addr)
            self.log.info(f"vars: {vars}")
            template.apply('rfs-router-intf-template', vars)

and changes to be done in template

<config-template xmlns="http://tail-f.com/ns/config/1.0"> <!-- Pas de servicepoint, sinon il override celui du Python, et le python n'est pas exécuté -->
  <devices xmlns="http://tail-f.com/ns/ncs">
    <device tags="merge">
      <name>{rfs_device_name}</name>
      <config>
        <interface xmlns="http://tail-f.com/ned/cisco-nx">
          <Vlan>
            <name>{$VLAN_ID}</name>
            <description>{$DESCRIPTION}</description>
            <ip>
              <address>
                <ipaddr>{$IP_ADDR}</ipaddr>
              </address>
            </ip>
          </Vlan>
        </interface>
      </config>
    </device>
  </devices>
</config-template>

 

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!

Hello mfr-6,

Your solution works, but I don't understand why.

Logs are as follows:

<INFO> 23-Aug-2024::11:17:20.258 rfs-router-intf ncs-dp-186859-rfs-router-intf:main:0-1-th-13418: - Service create(service=/ncs:services/rfs-router-intf:rfs_router_intf{RFS-router-intf-nx1})
<INFO> 23-Aug-2024::11:17:20.259 rfs-router-intf ncs-dp-186859-rfs-router-intf:main:0-1-th-13418: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 10'"), ('VLAN_ID', "'10'"), ('IP_ADD', "'10.1.1.1/24'")]
<INFO> 23-Aug-2024::11:17:20.264 rfs-router-intf ncs-dp-186859-rfs-router-intf:main:0-1-th-13418: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 20'"), ('VLAN_ID', "'20'"), ('IP_ADD', "'20.1.1.1/24'")]
<INFO> 23-Aug-2024::11:17:20.275 rfs-router-intf ncs-dp-186859-rfs-router-intf:main:0-1-th-13418: - Service create(service=/ncs:services/rfs-router-intf:rfs_router_intf{RFS-router-intf-nx2})
<INFO> 23-Aug-2024::11:17:20.275 rfs-router-intf ncs-dp-186859-rfs-router-intf:main:0-1-th-13418: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 10'"), ('VLAN_ID', "'10'"), ('IP_ADD', "'10.2.2.2/24'")]
<INFO> 23-Aug-2024::11:17:20.280 rfs-router-intf ncs-dp-186859-rfs-router-intf:main:0-1-th-13418: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 20'"), ('VLAN_ID', "'20'"), ('IP_ADD', "'20.2.2.2/24'")]

 

But if I want to "pythonize" only the description, all descrpiptions are "'NSO - RFS - vlan 20'", whereas logs are the same as above for DESCRIPTION.

XML:
        <interface xmlns="http://tail-f.com/ned/cisco-nx">
          <Vlan>
            <name>{/rfs_vlan/rfs_vlan_id}</name>
            <description>{$DESCRIPTION}</description>
            <ip>
              <address>
                <ipaddr>{rfs_ip_add}</ipaddr>
              </address>
            </ip>
          </Vlan>
        </interface>


Python:

        for vlan in service.rfs_vlan:
            desc = vlan.rfs_description
            vars.add('DESCRIPTION', 'NSO - RFS - ' + str(desc))
            self.log.info(f"vars: {vars}")
            template.apply('rfs-router-intf-template', vars)


admin@ncs(config)# services rfs_router_intf RFS-router-intf-nx1 rfs_device_name nx1 rfs_vlan 10 rfs_ip_add 10.1.1.1/24 rfs_description "vlan 10"
admin@ncs(config-rfs_vlan-10)# services rfs_router_intf RFS-router-intf-nx1 rfs_device_name nx1 rfs_vlan 20 rfs_ip_add 20.1.1.1/24 rfs_description "vlan 20"
admin@ncs(config-rfs_vlan-20)# services rfs_router_intf RFS-router-intf-nx2 rfs_device_name nx2 rfs_vlan 10 rfs_ip_add 10.2.2.2/24 rfs_description "vlan 10"
admin@ncs(config-rfs_vlan-10)# services rfs_router_intf RFS-router-intf-nx2 rfs_device_name nx2 rfs_vlan 20 rfs_ip_add 20.2.2.2/24 rfs_description "vlan 20"
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)# commit dry-run
cli {
    local-node {
        data  devices {
                  device nx1 {
                      config {
                          interface {
             +                Vlan 10 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 10.1.1.1/24;
             +                        }
             +                    }
             +                }
             +                Vlan 20 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 20.1.1.1/24;
             +                        }
             +                    }
             +                }
                          }
                      }
                  }
                  device nx2 {
                      config {
                          interface {
             +                Vlan 10 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 10.2.2.2/24;
             +                        }
             +                    }
             +                }
             +                Vlan 20 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 20.2.2.2/24;
             +                        }
             +                    }
             +                }
                          }
                      }
                  }
              }
              services {
             +    rfs_router_intf RFS-router-intf-nx1 {
             +        rfs_device_name nx1;
             +        rfs_vlan 10 {
             +            rfs_ip_add 10.1.1.1/24;
             +            rfs_description "vlan 10";
             +        }
             +        rfs_vlan 20 {
             +            rfs_ip_add 20.1.1.1/24;
             +            rfs_description "vlan 20";
             +        }
             +    }
             +    rfs_router_intf RFS-router-intf-nx2 {
             +        rfs_device_name nx2;
             +        rfs_vlan 10 {
             +            rfs_ip_add 10.2.2.2/24;
             +            rfs_description "vlan 10";
             +        }
             +        rfs_vlan 20 {
             +            rfs_ip_add 20.2.2.2/24;
             +            rfs_description "vlan 20";
             +        }
             +    }
              }
    }
}
admin@ncs(config-rfs_vlan-20)#


<INFO> 23-Aug-2024::11:26:48.410 rfs-router-intf ncs-dp-187002-rfs-router-intf:main:0-1-th-13502: - Service create(service=/ncs:services/rfs-router-intf:rfs_router_intf{RFS-router-intf-nx1})
<INFO> 23-Aug-2024::11:26:48.412 rfs-router-intf ncs-dp-187002-rfs-router-intf:main:0-1-th-13502: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 10'")]
<INFO> 23-Aug-2024::11:26:48.420 rfs-router-intf ncs-dp-187002-rfs-router-intf:main:0-1-th-13502: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 20'")]
<INFO> 23-Aug-2024::11:26:48.429 rfs-router-intf ncs-dp-187002-rfs-router-intf:main:0-1-th-13502: - Service create(service=/ncs:services/rfs-router-intf:rfs_router_intf{RFS-router-intf-nx2})
<INFO> 23-Aug-2024::11:26:48.430 rfs-router-intf ncs-dp-187002-rfs-router-intf:main:0-1-th-13502: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 10'")]
<INFO> 23-Aug-2024::11:26:48.438 rfs-router-intf ncs-dp-187002-rfs-router-intf:main:0-1-th-13502: - vars: [('DESCRIPTION', "'NSO - RFS - vlan 20'")]

 

 

mfr-6
Spotlight
Spotlight

@Noel Cantenot 

Could you please try the following commands after pipe when performing dry-run so we could see more details about what is happening?

 

 

commit dry-run | debug template
commit dry-run | debug xpath

 

 

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!

here it is.

What are those xpath evaluations of vrrp, ipv6, bfd... ?????

 

 

admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)# commit dry-run | debug template
Evaluating "rfs_device_name" (from file "rfs-router-intf-template.xml", line 4)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1'], it evaluates to "nx1"
Operation 'merge' on existing node: /devices/device[name='nx1'] (from file "rfs-router-intf-template.xml", line 4)
Evaluating "/rfs_vlan/rfs_vlan_id" (from file "rfs-router-intf-template.xml", line 8)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10"
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result: "NSO - RFS - vlan 10"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description to "NSO - RFS - vlan 10"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10.1.1.1/24"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr to "10.1.1.1/24"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']
Result: "NSO - RFS - vlan 10"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/description to "NSO - RFS - vlan 10"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20.1.1.1/24"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr to "20.1.1.1/24"
Evaluating "rfs_device_name" (from file "rfs-router-intf-template.xml", line 4)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1'], it evaluates to "nx1"
Operation 'merge' on existing node: /devices/device[name='nx1'] (from file "rfs-router-intf-template.xml", line 4)
Evaluating "/rfs_vlan/rfs_vlan_id" (from file "rfs-router-intf-template.xml", line 8)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10"
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20"
Operation 'merge' on existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result: "NSO - RFS - vlan 20"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description to "NSO - RFS - vlan 20"
Operation 'merge' on existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10.1.1.1/24"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr to "10.1.1.1/24"
Operation 'merge' on existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']
Result: "NSO - RFS - vlan 20"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/description to "NSO - RFS - vlan 20"
Operation 'merge' on existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20.1.1.1/24"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr to "20.1.1.1/24"
Evaluating "rfs_device_name" (from file "rfs-router-intf-template.xml", line 4)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2'], it evaluates to "nx2"
Operation 'merge' on existing node: /devices/device[name='nx2'] (from file "rfs-router-intf-template.xml", line 4)
Evaluating "/rfs_vlan/rfs_vlan_id" (from file "rfs-router-intf-template.xml", line 8)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10"
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20"
Operation 'merge' on non-existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']
Result: "NSO - RFS - vlan 10"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/description to "NSO - RFS - vlan 10"
Operation 'merge' on non-existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10.2.2.2/24"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr to "10.2.2.2/24"
Operation 'merge' on non-existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']
Result: "NSO - RFS - vlan 10"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/description to "NSO - RFS - vlan 10"
Operation 'merge' on non-existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20.2.2.2/24"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr to "20.2.2.2/24"
Evaluating "rfs_device_name" (from file "rfs-router-intf-template.xml", line 4)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2'], it evaluates to "nx2"
Operation 'merge' on existing node: /devices/device[name='nx2'] (from file "rfs-router-intf-template.xml", line 4)
Evaluating "/rfs_vlan/rfs_vlan_id" (from file "rfs-router-intf-template.xml", line 8)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10"
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20"
Operation 'merge' on existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']
Result: "NSO - RFS - vlan 20"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/description to "NSO - RFS - vlan 20"
Operation 'merge' on existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10.2.2.2/24"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr to "10.2.2.2/24"
Operation 'merge' on existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']
Result: "NSO - RFS - vlan 20"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/description to "NSO - RFS - vlan 20"
Operation 'merge' on existing node: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20'], it evaluates to "20.2.2.2/24"
Setting /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ip/address/ipaddr to "20.2.2.2/24"
cli {
    local-node {
        data  devices {
                  device nx1 {
                      config {
                          interface {
             +                Vlan 10 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 10.1.1.1/24;
             +                        }
             +                    }
             +                }
             +                Vlan 20 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 20.1.1.1/24;
             +                        }
             +                    }
             +                }
                          }
                      }
                  }
                  device nx2 {
                      config {
                          interface {
             +                Vlan 10 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 10.2.2.2/24;
             +                        }
             +                    }
             +                }
             +                Vlan 20 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 20.2.2.2/24;
             +                        }
             +                    }
             +                }
                          }
                      }
                  }
              }
              services {
             +    rfs_router_intf RFS-router-intf-nx1 {
             +        rfs_device_name nx1;
             +        rfs_vlan 10 {
             +            rfs_ip_add 10.1.1.1/24;
             +            rfs_description "vlan 10";
             +        }
             +        rfs_vlan 20 {
             +            rfs_ip_add 20.1.1.1/24;
             +            rfs_description "vlan 20";
             +        }
             +    }
             +    rfs_router_intf RFS-router-intf-nx2 {
             +        rfs_device_name nx2;
             +        rfs_vlan 10 {
             +            rfs_ip_add 10.2.2.2/24;
             +            rfs_description "vlan 10";
             +        }
             +        rfs_vlan 20 {
             +            rfs_ip_add 20.2.2.2/24;
             +            rfs_description "vlan 20";
             +        }
             +    }
              }
    }
}
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)#
admin@ncs(config-rfs_vlan-20)# commit dry-run | debug xpath
 2024-08-23T14:43:58.816 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_name: starts-with(current(), 'RFS-router-intf-')
 2024-08-23T14:43:58.816 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan) = {10}
 2024-08-23T14:43:58.816 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name: /ncs:devices/ncs:device/ncs:name
 2024-08-23T14:43:58.816 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_name: true (0.000 s)
 2024-08-23T14:43:58.816 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name) = nx2
 2024-08-23T14:43:58.816 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']) = {20}
 2024-08-23T14:43:58.816 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']) = false
 2024-08-23T14:43:58.816 xpath: exists(/devices/device[name='nx2']) = true
 2024-08-23T14:43:58.816 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add) = 20.2.2.2/24
 2024-08-23T14:43:58.816 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name) = nx2
 2024-08-23T14:43:58.816 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name: true (0.000 s)
 2024-08-23T14:43:58.817 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add) = 10.2.2.2/24
 2024-08-23T14:43:58.817 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_name: starts-with(current(), 'RFS-router-intf-')
 2024-08-23T14:43:58.817 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan) = {10}
 2024-08-23T14:43:58.817 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_name: true (0.000 s)
 2024-08-23T14:43:58.817 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name: /ncs:devices/ncs:device/ncs:name
 2024-08-23T14:43:58.817 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']) = {20}
 2024-08-23T14:43:58.817 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name) = nx1
 2024-08-23T14:43:58.817 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']) = false
 2024-08-23T14:43:58.817 xpath: exists(/devices/device[name='nx1']) = true
 2024-08-23T14:43:58.818 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name) = nx1
 2024-08-23T14:43:58.818 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add) = 20.1.1.1/24
 2024-08-23T14:43:58.818 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name: true (0.000 s)
 2024-08-23T14:43:58.818 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add) = 10.1.1.1/24
 2024-08-23T14:43:58.822 xpath: template rfs-router-intf-template: evaluating: rfs_device_name
 2024-08-23T14:43:58.823 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name: nx1
 2024-08-23T14:43:58.823 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.823 xpath: template rfs-router-intf-template: evaluating: /rfs_vlan/rfs_vlan_id
 2024-08-23T14:43:58.823 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']/rfs_vlan_id
 2024-08-23T14:43:58.824 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']/rfs_vlan_id
 2024-08-23T14:43:58.824 xpath: template rfs-router-intf-template: result: 2 nodes (0.000 s)
 2024-08-23T14:43:58.824 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']: ../../feature/interface-vlan
 2024-08-23T14:43:58.824 xpath: exists(/devices/device[name='nx1']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.824 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']: true (0.000 s)
 2024-08-23T14:43:58.825 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.825 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.825 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.825 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.826 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.826 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.826 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.826 xpath: exists(/devices/device[name='nx1']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.827 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.827 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.827 xpath: exists(/devices/device[name='nx1']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.827 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.828 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.828 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 10 (0.000 s)
 2024-08-23T14:43:58.828 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.828 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add: 10.1.1.1/24
 2024-08-23T14:43:58.828 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.828 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']: ../../feature/interface-vlan
 2024-08-23T14:43:58.829 xpath: exists(/devices/device[name='nx1']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.829 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']: true (0.000 s)
 2024-08-23T14:43:58.829 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.830 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.830 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.830 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.830 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.830 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.831 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.831 xpath: exists(/devices/device[name='nx1']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.831 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.831 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.831 xpath: exists(/devices/device[name='nx1']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.832 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.832 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.832 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 10 (0.000 s)
 2024-08-23T14:43:58.832 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.832 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add: 20.1.1.1/24
 2024-08-23T14:43:58.832 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.833 xpath: template rfs-router-intf-template: evaluating: rfs_device_name
 2024-08-23T14:43:58.833 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name: nx1
 2024-08-23T14:43:58.833 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.834 xpath: template rfs-router-intf-template: evaluating: /rfs_vlan/rfs_vlan_id
 2024-08-23T14:43:58.834 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']/rfs_vlan_id
 2024-08-23T14:43:58.834 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']/rfs_vlan_id
 2024-08-23T14:43:58.834 xpath: template rfs-router-intf-template: result: 2 nodes (0.000 s)
 2024-08-23T14:43:58.835 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']: ../../feature/interface-vlan
 2024-08-23T14:43:58.835 xpath: exists(/devices/device[name='nx1']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.835 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']: true (0.000 s)
 2024-08-23T14:43:58.835 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.835 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 20 (0.000 s)
 2024-08-23T14:43:58.835 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.835 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add: 10.1.1.1/24
 2024-08-23T14:43:58.836 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.836 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']: ../../feature/interface-vlan
 2024-08-23T14:43:58.836 xpath: exists(/devices/device[name='nx1']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.836 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']: true (0.000 s)
 2024-08-23T14:43:58.837 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.837 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 20 (0.000 s)
 2024-08-23T14:43:58.837 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.837 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add: 20.1.1.1/24
 2024-08-23T14:43:58.837 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.845 xpath: template rfs-router-intf-template: evaluating: rfs_device_name
 2024-08-23T14:43:58.845 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name: nx2
 2024-08-23T14:43:58.845 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.846 xpath: template rfs-router-intf-template: evaluating: /rfs_vlan/rfs_vlan_id
 2024-08-23T14:43:58.846 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']/rfs_vlan_id
 2024-08-23T14:43:58.846 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']/rfs_vlan_id
 2024-08-23T14:43:58.846 xpath: template rfs-router-intf-template: result: 2 nodes (0.000 s)
 2024-08-23T14:43:58.846 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']: ../../feature/interface-vlan
 2024-08-23T14:43:58.847 xpath: exists(/devices/device[name='nx2']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.847 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']: true (0.000 s)
 2024-08-23T14:43:58.848 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.848 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.848 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.848 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.849 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.849 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.849 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.849 xpath: exists(/devices/device[name='nx2']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.849 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.850 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.850 xpath: exists(/devices/device[name='nx2']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.850 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.850 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.850 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 10 (0.000 s)
 2024-08-23T14:43:58.850 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.851 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add: 10.2.2.2/24
 2024-08-23T14:43:58.851 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.851 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']: ../../feature/interface-vlan
 2024-08-23T14:43:58.851 xpath: exists(/devices/device[name='nx2']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.852 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']: true (0.000 s)
 2024-08-23T14:43:58.852 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.852 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.853 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.853 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.853 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.853 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.853 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.854 xpath: exists(/devices/device[name='nx2']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.854 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.854 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.854 xpath: exists(/devices/device[name='nx2']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.854 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.854 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.855 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 10 (0.000 s)
 2024-08-23T14:43:58.855 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.855 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add: 20.2.2.2/24
 2024-08-23T14:43:58.855 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.856 xpath: template rfs-router-intf-template: evaluating: rfs_device_name
 2024-08-23T14:43:58.856 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name: nx2
 2024-08-23T14:43:58.856 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.857 xpath: template rfs-router-intf-template: evaluating: /rfs_vlan/rfs_vlan_id
 2024-08-23T14:43:58.857 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']/rfs_vlan_id
 2024-08-23T14:43:58.857 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']/rfs_vlan_id
 2024-08-23T14:43:58.857 xpath: template rfs-router-intf-template: result: 2 nodes (0.000 s)
 2024-08-23T14:43:58.857 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']: ../../feature/interface-vlan
 2024-08-23T14:43:58.858 xpath: exists(/devices/device[name='nx2']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.858 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']: true (0.000 s)
 2024-08-23T14:43:58.858 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.858 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 20 (0.000 s)
 2024-08-23T14:43:58.858 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.858 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add: 10.2.2.2/24
 2024-08-23T14:43:58.858 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.858 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']: ../../feature/interface-vlan
 2024-08-23T14:43:58.859 xpath: exists(/devices/device[name='nx2']/config/nx:feature/interface-vlan) = true
 2024-08-23T14:43:58.859 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']: true (0.000 s)
 2024-08-23T14:43:58.859 xpath: template rfs-router-intf-template: evaluating: string($DESCRIPTION)
 2024-08-23T14:43:58.859 xpath: template rfs-router-intf-template: result: NSO - RFS - vlan 20 (0.000 s)
 2024-08-23T14:43:58.859 xpath: template rfs-router-intf-template: evaluating: rfs_ip_add
 2024-08-23T14:43:58.859 xpath: template rfs-router-intf-template: match: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add: 20.2.2.2/24
 2024-08-23T14:43:58.859 xpath: template rfs-router-intf-template: result: one node (0.000 s)
 2024-08-23T14:43:58.867 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan) = {10}
 2024-08-23T14:43:58.867 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_name: starts-with(current(), 'RFS-router-intf-')
 2024-08-23T14:43:58.868 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']) = {20}
 2024-08-23T14:43:58.868 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_name: starts-with(current(), 'RFS-router-intf-')
 2024-08-23T14:43:58.868 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name: /ncs:devices/ncs:device/ncs:name
 2024-08-23T14:43:58.868 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_name: true (0.000 s)
 2024-08-23T14:43:58.868 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']) = false
 2024-08-23T14:43:58.868 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan) = {10}
 2024-08-23T14:43:58.868 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_name: true (0.000 s)
 2024-08-23T14:43:58.868 xpath: evaluating: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name: /ncs:devices/ncs:device/ncs:name
 2024-08-23T14:43:58.868 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name) = nx1
 2024-08-23T14:43:58.868 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']) = {20}
 2024-08-23T14:43:58.868 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add) = 20.1.1.1/24
 2024-08-23T14:43:58.868 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name) = nx2
 2024-08-23T14:43:58.868 xpath: get_next(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']) = false
 2024-08-23T14:43:58.868 xpath: exists(/devices/device[name='nx1']) = true
 2024-08-23T14:43:58.868 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add) = 10.1.1.1/24
 2024-08-23T14:43:58.868 xpath: exists(/devices/device[name='nx2']) = true
 2024-08-23T14:43:58.868 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name) = nx1 [cached]
 2024-08-23T14:43:58.868 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='20']/rfs_ip_add) = 20.2.2.2/24
 2024-08-23T14:43:58.869 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name) = nx2 [cached]
 2024-08-23T14:43:58.869 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_device_name: true (0.000 s)
 2024-08-23T14:43:58.869 xpath: result: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_device_name: true (0.000 s)
 2024-08-23T14:43:58.869 xpath: get_elem(/services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx2']/rfs_vlan[rfs_vlan_id='10']/rfs_ip_add) = 10.2.2.2/24
 2024-08-23T14:43:58.880 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.880 xpath: exists(/devices/device[name='nx1']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.881 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.881 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.881 xpath: exists(/devices/device[name='nx1']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.881 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.881 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/vrrp: ../../../feature/vrrp
 2024-08-23T14:43:58.882 xpath: exists(/devices/device[name='nx1']/config/nx:feature/vrrp) = false
 2024-08-23T14:43:58.882 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/vrrp: false (0.000 s)
 2024-08-23T14:43:58.882 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/vrrpv3: ../../../feature/vrrpv3
 2024-08-23T14:43:58.882 xpath: exists(/devices/device[name='nx1']/config/nx:feature/vrrpv3) = false
 2024-08-23T14:43:58.882 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/vrrpv3: false (0.000 s)
 2024-08-23T14:43:58.884 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/nat: /nx:feature/nat
 2024-08-23T14:43:58.884 xpath: exists(/devices/device[name='nx1']/config/nx:feature/nat) = false
 2024-08-23T14:43:58.884 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/nat: false (0.000 s)
 2024-08-23T14:43:58.891 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.892 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.892 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.892 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.892 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.892 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.896 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/isis/bfd: /nx:feature/bfd
 2024-08-23T14:43:58.896 xpath: exists(/devices/device[name='nx1']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.896 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/isis/bfd: false (0.000 s)
 2024-08-23T14:43:58.897 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/isis/bfd-disable/bfd/disable: /nx:feature/bfd
 2024-08-23T14:43:58.898 xpath: exists(/devices/device[name='nx1']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.898 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/isis/bfd-disable/bfd/disable: false (0.000 s)
 2024-08-23T14:43:58.902 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.903 xpath: exists(/devices/device[name='nx1']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.903 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.903 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.903 xpath: exists(/devices/device[name='nx1']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.903 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.903 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/vrrp: ../../../feature/vrrp
 2024-08-23T14:43:58.904 xpath: exists(/devices/device[name='nx1']/config/nx:feature/vrrp) = false
 2024-08-23T14:43:58.904 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/vrrp: false (0.000 s)
 2024-08-23T14:43:58.904 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/vrrpv3: ../../../feature/vrrpv3
 2024-08-23T14:43:58.904 xpath: exists(/devices/device[name='nx1']/config/nx:feature/vrrpv3) = false
 2024-08-23T14:43:58.904 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/vrrpv3: false (0.000 s)
 2024-08-23T14:43:58.905 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ip/nat: /nx:feature/nat
 2024-08-23T14:43:58.905 xpath: exists(/devices/device[name='nx1']/config/nx:feature/nat) = false
 2024-08-23T14:43:58.905 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ip/nat: false (0.000 s)
 2024-08-23T14:43:58.910 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.911 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.911 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.911 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.912 xpath: exists(/devices/device[name='nx1']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.912 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.915 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/isis/bfd: /nx:feature/bfd
 2024-08-23T14:43:58.915 xpath: exists(/devices/device[name='nx1']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.915 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/isis/bfd: false (0.000 s)
 2024-08-23T14:43:58.916 xpath: evaluating: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/isis/bfd-disable/bfd/disable: /nx:feature/bfd
 2024-08-23T14:43:58.916 xpath: exists(/devices/device[name='nx1']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.916 xpath: result: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/isis/bfd-disable/bfd/disable: false (0.000 s)
 2024-08-23T14:43:58.920 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.920 xpath: exists(/devices/device[name='nx2']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.920 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.920 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.921 xpath: exists(/devices/device[name='nx2']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.921 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.921 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/vrrp: ../../../feature/vrrp
 2024-08-23T14:43:58.921 xpath: exists(/devices/device[name='nx2']/config/nx:feature/vrrp) = false
 2024-08-23T14:43:58.921 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/vrrp: false (0.000 s)
 2024-08-23T14:43:58.921 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/vrrpv3: ../../../feature/vrrpv3
 2024-08-23T14:43:58.922 xpath: exists(/devices/device[name='nx2']/config/nx:feature/vrrpv3) = false
 2024-08-23T14:43:58.922 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/vrrpv3: false (0.000 s)
 2024-08-23T14:43:58.923 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ip/nat: /nx:feature/nat
 2024-08-23T14:43:58.923 xpath: exists(/devices/device[name='nx2']/config/nx:feature/nat) = false
 2024-08-23T14:43:58.923 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ip/nat: false (0.000 s)
 2024-08-23T14:43:58.928 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.928 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.928 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.929 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.929 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.929 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.932 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/isis/bfd: /nx:feature/bfd
 2024-08-23T14:43:58.932 xpath: exists(/devices/device[name='nx2']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.932 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/isis/bfd: false (0.000 s)
 2024-08-23T14:43:58.933 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/isis/bfd-disable/bfd/disable: /nx:feature/bfd
 2024-08-23T14:43:58.933 xpath: exists(/devices/device[name='nx2']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.933 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='10']/isis/bfd-disable/bfd/disable: false (0.000 s)
 2024-08-23T14:43:58.937 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ospfv3: /nx:feature/ospfv3
 2024-08-23T14:43:58.937 xpath: exists(/devices/device[name='nx2']/config/nx:feature/ospfv3) = false
 2024-08-23T14:43:58.937 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ospfv3: false (0.000 s)
 2024-08-23T14:43:58.937 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/hsrp: ../../../feature/hsrp
 2024-08-23T14:43:58.938 xpath: exists(/devices/device[name='nx2']/config/nx:feature/hsrp) = false
 2024-08-23T14:43:58.938 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/hsrp: false (0.000 s)
 2024-08-23T14:43:58.938 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/vrrp: ../../../feature/vrrp
 2024-08-23T14:43:58.938 xpath: exists(/devices/device[name='nx2']/config/nx:feature/vrrp) = false
 2024-08-23T14:43:58.938 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/vrrp: false (0.000 s)
 2024-08-23T14:43:58.939 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/vrrpv3: ../../../feature/vrrpv3
 2024-08-23T14:43:58.939 xpath: exists(/devices/device[name='nx2']/config/nx:feature/vrrpv3) = false
 2024-08-23T14:43:58.939 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/vrrpv3: false (0.000 s)
 2024-08-23T14:43:58.940 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ip/nat: /nx:feature/nat
 2024-08-23T14:43:58.940 xpath: exists(/devices/device[name='nx2']/config/nx:feature/nat) = false
 2024-08-23T14:43:58.940 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ip/nat: false (0.000 s)
 2024-08-23T14:43:58.945 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/address: not(/nx:tailfned/iface-vlan-ipv6-secondary)
 2024-08-23T14:43:58.945 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.945 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/address: true (0.000 s)
 2024-08-23T14:43:58.945 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: /nx:tailfned/iface-vlan-ipv6-secondary
 2024-08-23T14:43:58.945 xpath: exists(/devices/device[name='nx2']/config/nx:tailfned/iface-vlan-ipv6-secondary) = false
 2024-08-23T14:43:58.945 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/ipv6/have-secondary-address: false (0.000 s)
 2024-08-23T14:43:58.948 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/isis/bfd: /nx:feature/bfd
 2024-08-23T14:43:58.948 xpath: exists(/devices/device[name='nx2']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.948 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/isis/bfd: false (0.000 s)
 2024-08-23T14:43:58.949 xpath: evaluating: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/isis/bfd-disable/bfd/disable: /nx:feature/bfd
 2024-08-23T14:43:58.949 xpath: exists(/devices/device[name='nx2']/config/nx:feature/bfd) = false
 2024-08-23T14:43:58.949 xpath: result: /devices/device[name='nx2']/config/nx:interface/Vlan[name='20']/isis/bfd-disable/bfd/disable: false (0.000 s)
cli {
    local-node {
        data  devices {
                  device nx1 {
                      config {
                          interface {
             +                Vlan 10 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 10.1.1.1/24;
             +                        }
             +                    }
             +                }
             +                Vlan 20 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 20.1.1.1/24;
             +                        }
             +                    }
             +                }
                          }
                      }
                  }
                  device nx2 {
                      config {
                          interface {
             +                Vlan 10 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 10.2.2.2/24;
             +                        }
             +                    }
             +                }
             +                Vlan 20 {
             +                    description "NSO - RFS - vlan 20";
             +                    ip {
             +                        address {
             +                            ipaddr 20.2.2.2/24;
             +                        }
             +                    }
             +                }
                          }
                      }
                  }
              }
              services {
             +    rfs_router_intf RFS-router-intf-nx1 {
             +        rfs_device_name nx1;
             +        rfs_vlan 10 {
             +            rfs_ip_add 10.1.1.1/24;
             +            rfs_description "vlan 10";
             +        }
             +        rfs_vlan 20 {
             +            rfs_ip_add 20.1.1.1/24;
             +            rfs_description "vlan 20";
             +        }
             +    }
             +    rfs_router_intf RFS-router-intf-nx2 {
             +        rfs_device_name nx2;
             +        rfs_vlan 10 {
             +            rfs_ip_add 10.2.2.2/24;
             +            rfs_description "vlan 10";
             +        }
             +        rfs_vlan 20 {
             +            rfs_ip_add 20.2.2.2/24;
             +            rfs_description "vlan 20";
             +        }
             +    }
              }
    }
}
admin@ncs(config-rfs_vlan-20)#

 

 

mfr-6
Spotlight
Spotlight

hi @Noel Cantenot 

Based on the "debug template" output, seems like NSO evaluates the template in a specific way. If you use values from nodes, then the template is evaluated in a single shot and it contains all yang node values referred multiple times. But since you loop over vlans in Python script, template is applied two times.
Let's see how the first iteration looks like:
Loop:

 

 

       for vlan in service.rfs_vlan:
            desc = vlan.rfs_description
            vars.add('DESCRIPTION', 'NSO - RFS - ' + str(desc))
            self.log.info(f"vars: {vars}")
            template.apply('rfs-router-intf-template', vars)

 

 

Under first iteration in Python script, under "vlan" variable in loop, you'll have "10". Just before your loop will go to the next element, the template is applied using "template.apply" method. This results in debug message that looks as follows:

 

 

Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result: "NSO - RFS - vlan 10" #### THIS SHOWS US THAT /VLAN/ IS EVALUATED TO 10 ####
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/description to "NSO - RFS - vlan 10"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr (from file "rfs-router-intf-template.xml", line 12)
Evaluating "rfs_ip_add" (from file "rfs-router-intf-template.xml", line 12)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10']
Result:
For /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='10'], it evaluates to "10.1.1.1/24"
Setting /devices/device[name='nx1']/config/nx:interface/Vlan[name='10']/ip/address/ipaddr to "10.1.1.1/24"
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20'] (from file "rfs-router-intf-template.xml", line 8)
Operation 'merge' on non-existing node: /devices/device[name='nx1']/config/nx:interface/Vlan[name='20']/description (from file "rfs-router-intf-template.xml", line 9)
Evaluating "$DESCRIPTION" (from file "rfs-router-intf-template.xml", line 9)
Context node: /services/rfs-router-intf:rfs_router_intf[rfs_name='RFS-router-intf-nx1']/rfs_vlan[rfs_vlan_id='20']
Result: "NSO - RFS - vlan 10" #### THIS SHOWS US THAT /VLAN/ IS EVALUATED TO 10 ####

 

 

 In the first iteration - DESCRIPTION becomes to be "NSO - RFS - vlan 10". But the interesting thing is that when you apply the template and use yang nodes directly, not through python vars - multiple values are applied at once!

In the second iteration, under "vlan" loop var, we will have "20". You can also see that multiple values from yang nodes are applied AGAIN at once, but this time, we have a difference in DESCRIPTION, because for this iteration it evaluates to "NSO - RFS - vlan20" which affects all vlan interfaces. You can also see messages like "Operation 'merge' on existing node" which tell us that we are applying the same things again. Since in the second iteration vlan id equals to 20 - DESCRIPTION is different and it is applied for ALL elements. That's why you see DESCRIPTION with vlan20 for both elements.

I think you should stick to Python vars and pass everything to template as a Python vars. This will solve your issue and help you avoid unexpected behaviors like this.

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!

Hi,

I don't understand why NSO est behaving like this, but I understand that when I use Python, it's all or nothing (at least when using a loop).

Thanks a lot for your analysis, very appreciated!