clicon / clixon-controller

Clixon network controller
Apache License 2.0
14 stars 5 forks source link

NETCONF delete messages include extra XML #53

Closed olofhagsand closed 11 months ago

olofhagsand commented 11 months ago

When clixon does a delete to a device it includes sub-statements that are not necessary. Some devices return errors on that. If you remove the sub-xml, the device accepts it. In the following example,, should not be part of the rpc message :

<rpc>  
  <edit-config>
    <target><candidate/></target>
    <default-operation>none</default-operation>
    <config>
      <configuration xmlns="device.uri">
        <mylist nc:operation="remove">
              <name>test</name>
              <extraconf>                         # <---  extra conf not necessary for delete
                       .....
              </extraconf>
        </mylist>
      </configuration>
    </config>
  </edit-config>
</rpc>]]>]]>
krihal commented 11 months ago
debian@khn-dev[/]# commit diff
juniper1:
            <group xmlns="http://yang.juniper.net/junos/conf/root">
               <name>test</name>
-              <neighbor>
-                 <name>1.1.1.1</name>
-                 <description>Foo</description>
-                 <import>test-in</import>
-                 <family>
-                    <inet>
-                       <unicast>
-                          <prefix-limit>
-                             <maximum>10</maximum>
-                             <teardown>
-                                <limit-threshold>20</limit-threshold>
-                                <idle-timeout>
-                                   <timeout>10</timeout>
-                                </idle-timeout>
-                             </teardown>
-                          </prefix-limit>
-                       </unicast>
-                    </inet>
-                 </family>
-                 <peer-as>4444</peer-as>
-              </neighbor>
            </group>
juniper2:
            <group xmlns="http://yang.juniper.net/junos/conf/root">
               <name>test</name>
-              <neighbor>
-                 <name>2.2.2.2</name>
-                 <description>Foo</description>
-                 <import>test-in</import>
-                 <family>
-                    <inet>
-                       <unicast>
-                          <prefix-limit>
-                             <maximum>10</maximum>
-                             <teardown>
-                                <limit-threshold>20</limit-threshold>
-                                <idle-timeout>
-                                   <timeout>10</timeout>
-                                </idle-timeout>
-                             </teardown>
-                          </prefix-limit>
-                       </unicast>
-                    </inet>
-                 </family>
-                 <peer-as>4444</peer-as>
-              </neighbor>
            </group>
OK
debian@khn-dev[/]# validate push
OK
debian@khn-dev[/]# commit
OK
debian@khn-dev[/]#