def AddServiceConsoleNic(self, nextName, portgroupName, ipConf, macAddr, enableInterface): fauxroot.longRunningFunction(1, "addserviceconsolenic") vnic = Vnic(nextName, portgroupName, ipConf) vnic.macAddress = macAddr # not yet used if enableInterface: vnic.Enable() self.nics.append(vnic) return self.nics[-1]
def AddServiceConsoleNic(self, nextName, portgroupName, ipConf, macAddr, enableInterface): fauxroot.longRunningFunction(1, 'addserviceconsolenic') vnic = Vnic(nextName, portgroupName, ipConf) vnic.macAddress = macAddr #not yet used if enableInterface: vnic.Enable() self.nics.append(vnic) return self.nics[-1]
def GetUplinks(self): fauxroot.longRunningFunction(1, "getuplinks") log.debug("VirtualSwitch.GetUplinks() called") return self.uplinks
def AddUplink(self, link): fauxroot.longRunningFunction(1, "adduplink") log.debug("VirtualSwitch.AddUplink() called") self.uplinks.append(link)
def GetAllPortGroupNames(self): fauxroot.longRunningFunction(1, "getallportgroupnames") return PortGroupImpl.allNames
def AddPortGroup(self, pgrpName): fauxroot.longRunningFunction(1, "addportgroup") retval = PortGroupImpl(pgrpName) self.portGroup[pgrpName] = retval return retval
def GetUplinks(self): fauxroot.longRunningFunction(1, 'getuplinks') log.debug("VirtualSwitch.GetUplinks() called") return self.uplinks
def GetPnics(self): fauxroot.longRunningFunction(1, "getpnics") return VMKCTL_NET_CONFIG["pnics"]
def CreateVnic(vnicName, portgroupName, macAddress): fauxroot.longRunningFunction(1, 'createvnic') vnic = Vnic(vnicName, portgroupName, None) vnic.macAddress = macAddress #not yet used return vnic
def SetIpConfig(self, ipConf): fauxroot.longRunningFunction(1, "setipconfig") self.ipConf = ipConf
def SetIpConfig(self, ipConf): fauxroot.longRunningFunction(1, 'setipconfig') self.ipConf = ipConf
def Enable(self): if self.enabled: raise Exception('This will cause a DHCP bug in vmkctl!') fauxroot.longRunningFunction(3, 'enable') self.enabled = True
def AddVirtualSwitch(self, name, portgroupSize=32): fauxroot.longRunningFunction(1, 'addvirtualswitch') self.rep[name] = VirtualSwitch(name, portgroupSize) return self.rep[name]
def GetVirtualSwitches(self): fauxroot.longRunningFunction(1, 'getvirtualswitches') return self.rep.values()
def AddUplink(self, link): fauxroot.longRunningFunction(1, 'adduplink') log.debug("VirtualSwitch.AddUplink() called") self.uplinks.append(link)
def GetVirtualSwitches(self): fauxroot.longRunningFunction(1, "getvirtualswitches") return self.rep.values()
def CreateVnic(vnicName, portgroupName, macAddress): fauxroot.longRunningFunction(1, "createvnic") vnic = Vnic(vnicName, portgroupName, None) vnic.macAddress = macAddress # not yet used return vnic
def AddVirtualSwitch(self, name, portgroupSize=32): fauxroot.longRunningFunction(1, "addvirtualswitch") self.rep[name] = VirtualSwitch(name, portgroupSize) return self.rep[name]
def GetAllPortGroupNames(self): fauxroot.longRunningFunction(1, 'getallportgroupnames') return PortGroupImpl.allNames
def Enable(self): if self.enabled: raise Exception("This will cause a DHCP bug in vmkctl!") fauxroot.longRunningFunction(3, "enable") self.enabled = True
def AddPortGroup(self, pgrpName): fauxroot.longRunningFunction(1, 'addportgroup') retval = PortGroupImpl(pgrpName) self.portGroup[pgrpName] = retval return retval
def extractISOChecksums(filename): img = StringIO('this is some fake file contents') checksumSize = 16 fauxroot.longRunningFunction(1, 'brandiso.calc_md5', 10) digest = brandiso.calc_md5(img, 0, checksumSize) return (BRANDISO_WRITTEN_DIGEST, digest, 'SOME_ID')
def GetPnics(self): fauxroot.longRunningFunction(1, 'getpnics') return VMKCTL_NET_CONFIG['pnics']