network
network copied to clipboard
Change ethtool features to use underscore instead of dashes
As discussed in https://github.com/linux-system-roles/network/issues/189#issuecomment-618020499, the ethtool features should use underscores instead of dashes. Since we already introduced the names with dashes, they need to be supported.
Implementation plan:
- [x] make role accept features with underscores in addition to dashes and update documentation to mention only the values with underscores - if options using dashes and underscores are mixed, fail
- [ ] add warnings when dashes are used
It would be great to introduce a marker for deprecated values ideally with extra information about what should be used instead to be able to do use this information also in the script from #208
Possible ideas:
Reference by string:
ArgValidatorBool("esp-hw-offload", default_value=None, deprecated_by="esp_hw_offload"),
ArgValidatorBool("esp_hw_offload", default_value=None),
or
Reference by object:
def __Init__self(self):
esp_hw_offload=ArgValidatorBool("esp_hw_offload", default_value=None),
ArgValidatorDict.__init__(
self,
name="features",
nested=[
ArgValidatorBool("esp-hw-offload", default_value=None, deprecated_by=esp_hw_offload),
esp_hw_offload
I guess the string makes it easier in case a value moves to a different subtree of the dictionary. Other ideas are welcome, too.