clicon / clixon

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

clixon Version 6.5.0: CLI -- > Variables of type bits, can't set more than one bit. Only last set argument is recognized. #492

Open coyote-dih opened 7 months ago

coyote-dih commented 7 months ago

The yang file "ieee802-dot1ab-lldp.yang" defines the follwing 'tlvs-tx-enable' leaf variable with bits 0 ... 3

  **leaf tlvs-tx-enable {
    type bits {
      bit port-desc {
        position 0;
        description
          "Transmit 'Port Description TLV'.";
      }
      bit sys-name {
        position 1;
        description
          "Transmit 'System Name TLV'.";
      }
      bit sys-desc {
        position 2"; 
        description
          "Transmit 'System Description TLV'.";
      }
      bit sys-cap {
        position 3; 
        description
          "Transmit 'System Capabilities TLV'.";
      }
    }

CLI device(/ieee802-dot1ab-lldp:lldp)> set port eth2 00-08-B0-02-03-04 tlvs-tx-enable port-desc
device(/ieee802-dot1ab-lldp:lldp)> commit device(/ieee802-dot1ab-lldp:lldp)> show
port eth2 00-08-B0-02-03-04 { tlvs-tx-enable port-desc; } device(/ieee802-dot1ab-lldp:lldp)> set port eth2 00-08-B0-02-03-04 tlvs-tx-enable sys-name port-desc CLI syntax error: "set port eth2 00-08-B0-02-03-04 tlvs-tx-enable sys-name port-desc": Unknown command

device(/ieee802-dot1ab-lldp:lldp)> set port eth2 00-08-B0-02-03-04 tlvs-tx-enable "sys-name port-desc" CLI syntax error: "set port eth2 00-08-B0-02-03-04 tlvs-tx-enable "sys-name port-desc"": Unknown command

device(/ieee802-dot1ab-lldp:lldp)> set port eth2 00-08-B0-02-03-04 tlvs-tx-enable sys-name device(/ieee802-dot1ab-lldp:lldp)> commit device(/ieee802-dot1ab-lldp:lldp)> show
port eth2 00-08-B0-02-03-04 { tlvs-tx-enable sys-name; }**

It isn't possible the set more than 1 bit in that tlvs-tx-enable variable at a time ! Maybe the syntax isn't quite correct?

olofhagsand commented 7 months ago

Correct. This is an obvious flaw in the AUTOCLI. You can only set one bit. See also: https://github.com/clicon/cligen/issues/102