vyos-1x icon indicating copy to clipboard operation
vyos-1x copied to clipboard

vyos_net_name: T5603: rework the helper not to use biosdevname

Open dmbaturin opened this issue 1 year ago • 5 comments

Change Summary

Since it's always supposed to be called with an explicit interface name argument, there is no reason to use that legacy code that was called without the --allow-vm argument anyway and thus would never work in VMs.

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Code style update (formatting, renaming)
  • [x] Refactoring (no functional changes)
  • [ ] Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • [ ] Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

vyos_net_name udev helper.

Proposed changes

I removed the option to call on_boot_event without an explicit predefined name and added a RuntimeError (which may not be a perfect exception choice...) when the script is called without correct arguments.

Also took a chance to rework debug messages and remove a bunch of extra whitespace.

How to test

Smoketest result

Interface names after boot should be the same as intended in the config.

Checklist:

  • [x] I have read the CONTRIBUTING document
  • [x] I have linked this PR to one or more Phabricator Task(s)
  • [ ] I have run the components SMOKETESTS if applicable
  • [x] My commit headlines contain a valid Task id
  • [ ] My change requires a change to the documentation
  • [ ] I have updated the documentation accordingly

dmbaturin avatar Jul 17 '24 12:07 dmbaturin