Exemplo n.º 1
0
def _getLinkSpeed(dev):
    if dev.isNIC():
        speed = netinfo.nicSpeed(dev.name)
    elif dev.isBOND():
        speed = netinfo.bondSpeed(dev.name)
    elif dev.isVLAN():
        speed = netinfo.vlanSpeed(dev.name)
    else:
        speed = 0
    return speed
Exemplo n.º 2
0
def _getLinkSpeed(dev):
    if dev.isNIC():
        speed = netinfo.nicSpeed(dev.name)
    elif dev.isBOND():
        speed = netinfo.bondSpeed(dev.name)
    elif dev.isVLAN():
        speed = netinfo.vlanSpeed(dev.name)
    else:
        speed = 0
    return speed
Exemplo n.º 3
0
 def _updateIfidsIfrates(self):
     devices = getLinks()
     self._ifids = [dev.name for dev in devices]
     self._ifrates = []
     for dev in devices:
         if dev.isNIC():
             speed = netinfo.nicSpeed(dev.name)
         elif dev.isBOND():
             speed = netinfo.bondSpeed(dev.name)
         elif dev.isVLAN():
             speed = netinfo.vlanSpeed(dev.name)
         else:
             speed = 0
         self._ifrates.append(speed)
Exemplo n.º 4
0
 def _updateIfidsIfrates(self):
     devices = getLinks()
     self._ifids = [dev.name for dev in devices]
     self._ifrates = []
     for dev in devices:
         if dev.isNIC():
             speed = netinfo.nicSpeed(dev.name)
         elif dev.isBOND():
             speed = netinfo.bondSpeed(dev.name)
         elif dev.isVLAN():
             speed = netinfo.vlanSpeed(dev.name)
         else:
             speed = 0
         self._ifrates.append(speed)