recover_duts: spruce up reload_network_device

There's a lot of problems in this file

 * it's no longer used in a udev rule [1] -- it's only used in test images,
   for the 'check_ethernet' hook used in the lab; so remove some of the
   udev cruft
 * it isn't very nice for interactive use (most of its errors go only to
   syslog; it doesn't give clear expectations about its args)
 * it tries to control wlan power, if used on a wlan device; this will
   fail on a lot of devices, which means you'll be stuck (we already
   removed the driver module at this point, and 'set -e' means we fail
   hard). That's not even verified or recommended even on those devices
   where it may work. So stop doing it.
 * not all drivers are modules

This cleans up most of that.

Currently, check_ethernet.hook only calls this for ethernet devices. Now
it is safe(r) to use on wlan devices too.

[1] https://chromium-review.googlesource.com/493888

BUG=b:112780859
TEST=`reload_network_device`, with {lo,eth0,wlan0} args, and without
     args

Change-Id: I61dcff44e3293b1d4fc9ff29ed21fe42cd3d344d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1565198
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Grant Grundler <grundler@chromium.org>
1 file changed