]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: bond: refactor get_bond_slaves function
authorJulien Fortin <julien@cumulusnetworks.com>
Mon, 13 Apr 2020 13:21:49 +0000 (15:21 +0200)
committerJulien Fortin <julien@cumulusnetworks.com>
Tue, 14 Apr 2020 14:33:48 +0000 (16:33 +0200)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
ifupdown2/addons/bond.py

index b79ccf1ea5653ce660905d814f7973f5dadd903a..415ee68082db7138a98f017fafd1448f3132c3aa 100644 (file)
@@ -250,12 +250,10 @@ class bond(Addon, moduleBase):
         self._bond_attr_ifquery_check_translate_func[Link.IFLA_BOND_PRIMARY] = self.cache.get_ifindex
         self._bond_attr_set_list = self._bond_attr_set_list + (('bond-primary', Link.IFLA_BOND_PRIMARY, self.cache.get_ifindex),)
 
-    @staticmethod
-    def get_bond_slaves(ifaceobj):
-        slaves = ifaceobj.get_attr_value_first('bond-slaves')
-        if not slaves:
-            slaves = ifaceobj.get_attr_value_first('bond-ports')
-        return slaves
+
+    def get_bond_slaves(self, ifaceobj):
+        # bond-ports aliases should be translated to bond-slaves
+        return ifaceobj.get_attr_value_first('bond-slaves')
 
     def _is_bond(self, ifaceobj):
         # at first link_kind is not set but once ifupdownmain