reading from /sys/class/net/eth0/carriers raises IOError if interface is down
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
New
|
Undecided
|
Unassigned |
Bug Description
If an interface is "down", reading from several of the sysfs files for that interface will return EINVAL, which causes Python to raise an IOError like this:
Dec 02 18:11:09 citest.novalocal cloud-init[413]: [CLOUDINIT] util.py[DEBUG]: failed stage init-local
apper
rk_config
rking_config
ate_fallback_config
etdev_info
The code calling sys_netdev_info should catch IOError as well as OSError.
A simple reproducer is:
# ip link set eth0 down
# cat /sys/class/
cat: /sys/class/