Skip to content

nmcli: fix setting wake-on-lan property on edit mode

When setting a property using nmcli edit mode, the "set" command is appending. In order to do not break users that could be using set as "append", we are introducing exceptions for the properties where this does not make sense.

"wake-on-lan" property does not accept multiple values, so we are using internal set MODIFICATOR instead. This way "set .wake-on-lan " will set the new value instead of append it.

nmcli> set 802-3-ethernet.wake-on-lan
Allowed values for 'wake-on-lan' property: phy, unicast, multicast, broadcast, arp, magic, default, ignore
Enter 'wake-on-lan' value:
nmcli> print 802-3-ethernet.wake-on-lan
802-3-ethernet.wake-on-lan: default
nmcli> set 802-3-ethernet.wake-on-lan phy
nmcli> print 802-3-ethernet.wake-on-lan
802-3-ethernet.wake-on-lan: phy
nmcli> set 802-3-ethernet.wake-on-lan broadcast
nmcli> print 802-3-ethernet.wake-on-lan
802-3-ethernet.wake-on-lan: broadcast

https://bugzilla.redhat.com/show_bug.cgi?id=2016348

Merge request reports