Diff comments:
> diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py > index d1740e5..5a4a232 100644 > --- a/cloudinit/net/__init__.py > +++ b/cloudinit/net/__init__.py > @@ -77,7 +78,7 @@ def read_sys_net_int(iface, field): > return None > try: > return int(val) > - except TypeError: > + except ValueError: int() raises a ValueError not a TypeError. > return None > > > @@ -149,7 +150,14 @@ def device_devid(devname): > > > def get_devicelist(): > - return os.listdir(SYS_CLASS_NET) > + try: Pulled this common exception handling logic into get_devicelist so it's not replicated at call sites. > + devs = os.listdir(SYS_CLASS_NET) > + except OSError as e: > + if e.errno == errno.ENOENT: > + devs = [] > + else: > + raise > + return devs > > > class ParserError(Exception): -- https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/327827 Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:unittests-in-cloudinit-package into cloud-init:master. _______________________________________________ Mailing list: https://launchpad.net/~cloud-init-dev Post to : cloud-init-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~cloud-init-dev More help : https://help.launchpad.net/ListHelp