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

cloudinit.net refactor: find_fallback_nic #3722

Open
ubuntu-server-builder opened this issue May 12, 2023 · 1 comment
Open

cloudinit.net refactor: find_fallback_nic #3722

ubuntu-server-builder opened this issue May 12, 2023 · 1 comment
Labels
enhancement New feature or request launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1884606

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2020-06-22T20:30:35.898363+00:00
date_fix_committed = None
date_fix_released = None
id = 1884606
importance = wishlist
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1884606
milestone = None
owner = oddbloke
owner_name = Dan Watkins
private = False
status = triaged
submitter = oddbloke
submitter_name = Dan Watkins
tags = ['net-refactor']
duplicates = []

Launchpad user Dan Watkins(oddbloke) wrote on 2020-06-22T20:30:35.898363+00:00

This bug is tracking part of the refactor of cloudinit.net into
cloudinit.distros.networking, specifically the refactoring of the function
named in the title of this bug. See [0] for further details.

[0] https://cloudinit.readthedocs.io/en/latest/topics/hacking.html#cloudinit-net-cloudinit-distros-networking-hierarchy

@ubuntu-server-builder ubuntu-server-builder added enhancement New feature or request launchpad Migrated from Launchpad labels May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Ryan Harper(raharper) wrote on 2020-06-24T19:05:31.646771+00:00

It would be good to refactor this to match what's in cloudinit/net/init.py:find_fallback_nic_linux() where we're looking for connected devices...

carrier = read_sys_net_int(interface, 'carrier')
if carrier:
connected.append(interface)
continue

check if nic is dormant or down, as this may make a nick appear to

not have a carrier even though it could acquire one when brought

online by dhclient

dormant = read_sys_net_int(interface, 'dormant')
if dormant:
possibly_connected.append(interface)
continue
operstate = read_sys_net_safe(interface, 'operstate')
if operstate in ['dormant', 'down', 'lowerlayerdown', 'unknown']:
possibly_connected.append(interface)
continue

Original discussion here:
https://github.com/canonical/cloud-init/pull/453/files#r444272062

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant