Skip to content

Instantly share code, notes, and snippets.

@igalic
Created October 26, 2022 20:59
Show Gist options
  • Save igalic/e05440564d52fa70f78fa48230085d44 to your computer and use it in GitHub Desktop.
Save igalic/e05440564d52fa70f78fa48230085d44 to your computer and use it in GitHub Desktop.
diff --git a/cloudinit/distros/networking.py b/cloudinit/distros/networking.py
index ea966283..877887b4 100644
--- a/cloudinit/distros/networking.py
+++ b/cloudinit/distros/networking.py
@@ -195,8 +195,9 @@ class BSDNetworking(Networking):
self._update_ifs()
def _update_ifs(self):
- ifs_txt, _ = subp.subp(["ifconfig", "-a"])
- self.ifs = self.ifc.parse(ifs_txt)
+ ifconf = subp.subp(["ifconfig", "-a"])
+ if ifconf[0]:
+ self.ifs = self.ifc.parse(ifconf[0])
def apply_network_config_names(self, netcfg: NetworkConfig) -> None:
LOG.debug("Cannot rename network interface.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment