binding/python: ifindex 0 is invalid so do not process it

On some platforms, libraries underpinning libteam assert that an ifindex
passed to them is not zero so an ifindex of zero cannot be passed down.
This patch alters libteam processing order to ensure that this is the

Signed-off-by: Paul D.Smith <>
Signed-off-by: Jiri Pirko <>
diff --git a/binding/python/team/ b/binding/python/team/
index 54161bf..b8569f9 100644
--- a/binding/python/team/
+++ b/binding/python/team/
@@ -101,7 +101,8 @@
     def ifindex(self, ifindex):
         self._ifindex = ifindex
-        self.ifname = self._conv.dev_ifname(ifindex)
+        if self.ifindex:
+            self.ifname = self._conv.dev_ifname(ifindex)
     def get_hwaddr(self):
         err, hwaddr = capi.team_hwaddr_get(self._th, self.ifindex, 6)