]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
dhclient: check for out variable being None
authorAndy Roulin <aroulin@nvidia.com>
Mon, 4 Jan 2021 22:07:11 +0000 (14:07 -0800)
committerJulien Fortin <julien@cumulusnetworks.com>
Mon, 25 Jan 2021 18:20:50 +0000 (19:20 +0100)
Fixes: 765075ba392 ("dhclient: wait to start dhcp if carrier is down")
Signed-off-by: Andy Roulin <aroulin@nvidia.com>
ifupdown2/ifupdownaddons/dhclient.py

index ef849d6b21a11c6c76357ff516a8698d25a69caf..1b61702eecbd9b6ba7bb0a8cd042eae81035bf6a 100644 (file)
@@ -73,6 +73,8 @@ class dhclient(utilsBase):
         while '1' not in out and retries < 5:
             path = 'sys/class/net/%s/carrier' %ifacename
             out = self.read_file_oneline(path)
+            if out is None:
+                break # No sysfs file found for this iface
             retries += 1
             time.sleep(1)