summaryrefslogtreecommitdiff
path: root/cloudinit/net/__init__.py
AgeCommit message (Collapse)Author
2016-03-22Fix typoWesley Wiedenmeier
2016-03-22Wrap read calls to /sys/class/net/DEV/{carrier, dormant, operstate} inWesley Wiedenmeier
try/except blocks because there are sometimes read errors on the files and this should not cause a stacktrace
2016-03-21Added net.find_fallback_network_device() to find an appropriate device to dhcpWesley Wiedenmeier
on in the event that no network configuration was provided to cloud-init - Devices in /sys/class/net aside from loopback devices are scanned - Each device is tested to determine if it has a carrier using /sys/class/net/DEV/carrier, devices which do are preferred as they are most likely connected to the outside world - Devices which do not have a carrier but which might still be connected due to being in a dormant or down state are used as fallbacks in case no devices are found which have a carrier - A network state dictionary is generated to be passed to render_network_state to write ENI - A systemd link file is generated that will rename the chosen device to eth0
2016-03-18Added commentsWesley Wiedenmeier
2016-03-18Handle static ip= entries by appending a static subnet to the deviceWesley Wiedenmeier
2016-03-18If proto not specified, determine it using logic from:Wesley Wiedenmeier
lp:cloud-initramfs-tools/dyn-netconf/scripts/init-bottom/cloud-initramfs-dyn-netconf
2016-03-18Fully parse files at /run/net-dev.conf, loading parameters for address,Wesley Wiedenmeier
broadcast, netmask, gateway and hostname if present
2016-03-17Check for and merge in configuration caused by the 'ip' parameter on theWesley Wiedenmeier
kernel's cmdline during network configuration parsing. - Search for .conf files in /run with names starting with 'net', as these are created during early boot if the ip parameter is present - If any are present and valid they are merged with network configuration from the current data source - If the devices affected by the 'ip' parameter are already present in network configuration, then a subnet entry will be added to the device's configuration unless an identical entry is already present - If any of the devices affected are not present then a mostly blank configuration will be generated for the device and the appropriate subnet specified
2016-03-10adjust net to fit with cloudinitScott Moser
at this point, this works: python -m cloudinit.net.network_state examples/network-all.yaml
2016-03-10initial copy of curtin netScott Moser
just add curtin/net as cloudinit/net and then copy curtin/udev.py as cloudinit/net/udev.py