network icon indicating copy to clipboard operation
network copied to clipboard

Change ethtool features to use underscore instead of dashes

Open tyll opened this issue 5 years ago • 1 comments

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

tyll avatar Apr 24 '20 11:04 tyll

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.

tyll avatar Apr 27 '20 14:04 tyll