clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
206 stars 69 forks source link

problem with the auto-disclosure of leafref values #495

Open khromenokroman opened 5 months ago

khromenokroman commented 5 months ago

Good afternoon/night

I have a problem with the auto-disclosure of leafref values when leafref is in the union type.

Example:

That's how it works

leaf-list src-address { 
        type union { 
         type leafref {
          path "../../../../../address/ipv4/ipv4-address/address-group/group-name";
         }
        }
        }
 root@pc/> set context sample firewall access-policy acl_ipv4 acl-entry 1 src-address
  INTERNAL_SERVER_NETWORK 
  NAT-DYNAMIC             
  NAT-STATIC           
  <dst-address>   

root@pc/> set context sample firewall access-policy acl_ipv4 acl-entry 1 dst-address

It does not work with this setting

 leaf-list src-address { 
        type union { 
         type leafref {
          path "../../../../../address/ipv4/ipv4-address/address-group/group-name";
         }
         type enumeration{
         enum ANY;
         }
        }
        }
root@pc/> set context sample firewall access-policy acl_ipv4 acl-entry 1 src-address
  ANY
  INTERNAL_SERVER_NETWORK
  <src-address>
root@pc/> set context sample firewall access-policy acl_ipv4 acl-entry 1 src-address

Can you help me solve this problem?

olofhagsand commented 2 months ago

Can you please include the yang for the leafref path, ie: /address/ipv4/ipv4-address/address-group/group-name ?