Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix networkinterfaces processes #263

Merged
merged 6 commits into from
Jun 20, 2023

Conversation

sohorx
Copy link
Contributor

@sohorx sohorx commented Jun 12, 2023

This PR is a continuation of: #235.

This will be a series of PRs, and this is Part 1 where only the Python code is affected. The aim is to fix any potential errors or missbehavior (no breaking changes should be present).

(Part 2 will focus on hotplug/udev handling, and Part 3 will involve reworking and questioning the arguments. Each part should be independent and merge without conflicts with the other two.)

This PR includes the following changes:

  • Makes "auto" an alias for "allow-auto" (with the same handling and container).
  • Fixes the range for "ifquery/up/down" for "eth[1-2]", bringing only "eth1".
  • Clarifies and cleans up some code in "networkinterfaces.py" and "utils.py".
  • Improves error handling for the "allow" keyword.

sohorx added 6 commits June 12, 2023 15:31
Replace indexing by variables named start/end and prefix/suffix.
ifquery excluded the last digit of interfaces range given.
ex: eth[1-2] would give only eth1 instead of eth1 + eth2.

This commit fix this behavior by increasing the range in
expand_iface_range.
The commit make the auto_ifaces container pointing to the
allow_classes['auto'] list. (since it's a mutable object, we get
the same instance)
This change goal is to make auto behave like allow-auto.
This commit will also provide the interfaces range capability to any
other allow-class names.
The only real change is the creation of a ifaceobj before testing it's
name. (The ifaceobj will still not be added if deemed invalid)
This commit fix the following by making an understandable error msg:
* the 'allow eth0' would make a IndexError shown to the user.
* the 'allow-' would be valid and use an empty classname.
@sohorx sohorx mentioned this pull request Jun 13, 2023
@julienfortin julienfortin merged commit bc8dfef into CumulusNetworks:master Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants