cloud-init icon indicating copy to clipboard operation
cloud-init copied to clipboard

cloudinit.net refactor: find_fallback_nic

Open ubuntu-server-builder opened this issue 2 years ago • 2 comments

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 avatar May 12 '23 07:05 ubuntu-server-builder

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

ubuntu-server-builder avatar May 12 '23 07:05 ubuntu-server-builder

See https://github.com/canonical/cloud-init/issues/3716 (leaving this one open due to additional comment)

TheRealFalcon avatar May 15 '25 10:05 TheRealFalcon