docs: def get_bond_master(interface):
      """Returns bond master if interface is bond slave otherwise None.
  
      NOTE: the provided interface is expected to be physical
      """
      if interface:
          iface_path = '/sys/class/net/%s' % (interface)
          if os.path.exists(iface_path):
              if '/virtual/' in os.path.realpath(iface_path):
                  return None
  
              master = os.path.join(iface_path, 'master')
              if os.path.exists(master):
                  master = os.path.realpath(master)
                  # make sure it is a bond master
                  if os.path.exists(os.path.join(master, 'bonding')):
                      return os.path.basename(master)
  
      return None