def isHidden(self): """Returns True iff vdsm config hides the device.""" if self.isVLAN(): return anyFnmatch(self.name, self._hiddenVlans) elif self.isNICLike(): return (anyFnmatch(self.name, self._hiddenNics) or (self.master and _bondExists(self.master) and anyFnmatch(self.master, self._hiddenBonds)) or (self.isVF() and self._isVFhidden())) elif self.isBOND(): return anyFnmatch(self.name, self._hiddenBonds) elif self.isBRIDGE(): return self.name == DUMMY_BRIDGE return False
def isFakeNIC(self): """ Returns True iff vdsm config marks the DUMMY or VETH dev to be reported as NIC. """ if self.isDUMMY() or self.isVETH() or self.isMACVLAN(): return anyFnmatch(self.name, self._fakeNics) return False
def testAnyFnmatch(self): self.assertTrue(utils.anyFnmatch('test1', ['test0', 'test1']))