def _collectItemsToDelete(self, linux_, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.variableCollections.keys(): if self.variableCollections[key]: res = self.variableCollections[key]._collectItemsToDelete( linux_, key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log( 'collect-items-to-delete-variableCollection-failed' ).errorFunc(): logFunc( 'variableCollectionObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath(linux_, None) xmlVal = Value() xmlVal.setXmlTag(( "variable-collection", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-linux-variables", "qt-lnx-variables")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def readListKeys (self , lake , fish_ , trxContext=None): self.myInitGuard.isInitOrCrash() for logFunc in self._log('read-list-keys').debug3Func(): logFunc('called') # clear the old map self.testGenerationUnderscores = {} self.testGenerationUnderscoreKeys = [] keyPath = self._getSelfKeyPath(lake, fish_, None) xmlVal = Value() xmlVal.setXmlTag(("test-generation_underscore", "http://qwilt.com/model/lake-example", "lake-example")) keyPath.addKeyPathPostfix(xmlVal) keys = [] res = self.domain.readMaapiKeys(keyPath, keys, trxContext) if res != ReturnCodes.kOk: for logFunc in self._log('read-list-keys-domain-failed').errorFunc(): logFunc('domain.readMaapiKeys() failed') return ReturnCodes.kGeneralError for key in keys: self.testGenerationUnderscoreKeys.append(key.getCannonicalStr()) self.testGenerationUnderscores[key.getCannonicalStr()] = None return ReturnCodes.kOk
def readListKeys (self , trxContext=None): self.myInitGuard.isInitOrCrash() for logFunc in self._log('read-list-keys').debug3Func(): logFunc('called') # clear the old map self.aliens = {} self.alienKeys = [] keyPath = self._getSelfKeyPath( None) xmlVal = Value() xmlVal.setXmlTag(("alien", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPostfix(xmlVal) keys = [] res = self.domain.readMaapiKeys(keyPath, keys, trxContext) if res != ReturnCodes.kOk: for logFunc in self._log('read-list-keys-domain-failed').errorFunc(): logFunc('domain.readMaapiKeys() failed') return ReturnCodes.kGeneralError for key in keys: self.alienKeys.append(key.getCannonicalStr()) self.aliens[key.getCannonicalStr()] = None return ReturnCodes.kOk
def readListKeys (self , ipv4 , trxContext=None): self.myInitGuard.isInitOrCrash() for logFunc in self._log('read-list-keys').debug3Func(): logFunc('called') # clear the old map self.hosts = {} self.hostKeys = [] keyPath = self._getSelfKeyPath(ipv4, None) xmlVal = Value() xmlVal.setXmlTag(("host", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")) keyPath.addKeyPathPostfix(xmlVal) keys = [] res = self.domain.readMaapiKeys(keyPath, keys, trxContext) if res != ReturnCodes.kOk: for logFunc in self._log('read-list-keys-domain-failed').errorFunc(): logFunc('domain.readMaapiKeys() failed') return ReturnCodes.kGeneralError for key in keys: self.hostKeys.append(key.getCannonicalStr()) self.hosts[key.getCannonicalStr()] = None return ReturnCodes.kOk
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("thresholds", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log", "qt-log")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("log-archiving", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log", "qt-log")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("housekeeper", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log", "qt-log")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("log", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log", "qt-log")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath (self, lake , fish_ , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS. junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() ancestorVal = Value() ancestorVal.setString(fish_); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("fish", "http://qwilt.com/model/lake-example", "lake-example")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(lake); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("lake", "http://qwilt.com/model/lake-example", "lake-example")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _collectItemsToDelete (self, ipv4, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.hosts.keys(): if self.hosts[key]: res = self.hosts[key]._collectItemsToDelete(ipv4, key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log('collect-items-to-delete-host-failed').errorFunc(): logFunc('hostObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath(ipv4, None) xmlVal = Value() xmlVal.setXmlTag(("host", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def createSecToGroupTableEntry (self, trxContext, securityModel, securityName): self._log("create-sec-to-group-table-entry").debug2("called. trxContext=%s, securityModel=%s, securityName=%s", trxContext, securityModel, securityName) """ create an entry with the securityName in SNMP-VIEW-BASED-ACM-MIB vacmSecurityToGroupTable vacmSecurityToGroupEntry set vacmSecurityModel to securityModel set vacmSecurityName to securityName set vacmGroupName to notif-only """ self._log("create-sec-to-group-table-entry").debug2("called. trxContext=%s, securityModel=%s, securityName=%s", trxContext, securityModel, securityName) targetKeyPath = KeyPath() valVacm = Value() (tag, ns, prefix) = ("SNMP-VIEW-BASED-ACM-MIB", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valVacm.setXmlTag((tag, ns, prefix)) targetKeyPath.addKeyPathPostfix(valVacm) tagValueList = TagValues() valVacmSecToGroupTable = Value() (tag, ns, prefix) = ("vacmSecurityToGroupTable", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valVacmSecToGroupTable.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valVacmSecToGroupTable) valBegin = Value() (tag, ns, prefix) = ("vacmSecurityToGroupEntry", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valBegin.setXmlBegin((tag, ns, prefix)) tagValueList.push((tag, ns), valBegin) valKeyModel = Value() valKeyModel.setInt32(securityModel) tagValueList.push(("vacmSecurityModel", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z"), valKeyModel) valKeySecName = Value() valKeySecName.setString(securityName) tagValueList.push(("vacmSecurityName", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z"), valKeySecName) # vacmGroupName to notif-only valGroupName = Value() valGroupName.setString(self.AC_NOTIF_ONLY) tagValueList.push(("vacmGroupName", "http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z"), valGroupName) valEnd = Value() valEnd.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valEnd) valTargetParamTable = Value() (tag, ns, prefix) = ("vacmSecurityToGroupTable","http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z", "SNMP_VIEW_BASED_ACM_MIB") valTargetParamTable.setXmlEnd((tag, ns, prefix)) tagValueList.push((tag, ns), valTargetParamTable) res = self._maapiDomain.writeMaapi(tagValueList, targetKeyPath, trxContext) if res != ReturnCodes.kOk: self._log('create-sec-to-group-table-entry-write-domain-failed').error('self._maapiDomain.writeMaapi() failed. PARAMS') return ReturnCodes.kGeneralError self._log("create-sec-to-group-table-entry-done").debug2("done. trxContext=%s, securityModel=%s, securityName=%s", trxContext, securityModel, securityName) return ReturnCodes.kOk
def remove (self, trxContext, keyPath): self._log("remove").debug2("called. trxContext=%s, keyPath=%s", trxContext, keyPath) valLeafTag = keyPath.getAt(keyPath.getLen()-1).asXmlTag() self._log("remove-details").debug2("read details: valLeafTag=%s. trxContext=%s, keyPath=%s", valLeafTag, trxContext, keyPath) pathToDelete = copy.deepcopy(self._keyPathSnmpV2) doDelete = False if valLeafTag[0] == "contact": valContact = Value() (tag, ns, prefix) = ("sysContact", "http://tail-f.com/ns/mibs/SNMPv2-MIB/200210160000Z", "SNMPv2_MIB") valContact.setXmlTag((tag, ns, prefix)) pathToDelete.addKeyPathPostfix(valContact) doDelete = True if valLeafTag[0] == "location": valLocation = Value() (tag, ns, prefix) = ("sysLocation", "http://tail-f.com/ns/mibs/SNMPv2-MIB/200210160000Z", "SNMPv2_MIB") valLocation.setXmlTag((tag, ns, prefix)) pathToDelete.addKeyPathPostfix(valLocation) doDelete = True if doDelete: res = self._maapiDomain.writeMaapi(None, None, trxContext, itemsToDelete=[pathToDelete]) if res != ReturnCodes.kOk: self._log("remove-write-maapi-failed").notice("self._maapiDomain.writeMaapi() failed. pathToDelete=%s, trxContext=%s, keyPath=%s", pathToDelete, trxContext, keyPath) return ReturnCodes.kGeneralError return ReturnCodes.kOk
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("simulation", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-power", "qt-pltf-pwr")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("system-defaults", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-power", "qt-pltf-pwr")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("power", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-power", "qt-pltf-pwr")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("platform", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform", "qt-pltf")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def readListKeys (self , show , trxContext=None): self.myInitGuard.isInitOrCrash() for logFunc in self._log('read-list-keys').debug3Func(): logFunc('called') # clear the old map self.actors = {} self.actorKeys = [] keyPath = self._getSelfKeyPath(show, None) xmlVal = Value() xmlVal.setXmlTag(("actor", "http://qwilt.com/model/tv", "tv")) keyPath.addKeyPathPostfix(xmlVal) keys = [] res = self.domain.readMaapiKeys(keyPath, keys, trxContext) if res != ReturnCodes.kOk: for logFunc in self._log('read-list-keys-domain-failed').errorFunc(): logFunc('domain.readMaapiKeys() failed') return ReturnCodes.kGeneralError for key in keys: self.actorKeys.append(key.getCannonicalStr()) self.actors[key.getCannonicalStr()] = None return ReturnCodes.kOk
def readListKeys(self, rule, trxContext=None): self.myInitGuard.isInitOrCrash() for logFunc in self._log('read-list-keys').debug3Func(): logFunc('called') # clear the old map self.sourceZones = {} self.sourceZoneKeys = [] keyPath = self._getSelfKeyPath(rule, None) xmlVal = Value() xmlVal.setXmlTag( ("source-zone", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content", "qtc")) keyPath.addKeyPathPostfix(xmlVal) keys = [] res = self.domain.readMaapiKeys(keyPath, keys, trxContext) if res != ReturnCodes.kOk: for logFunc in self._log( 'read-list-keys-domain-failed').errorFunc(): logFunc('domain.readMaapiKeys() failed') return ReturnCodes.kGeneralError for key in keys: self.sourceZoneKeys.append(key.getCannonicalStr()) self.sourceZones[key.getCannonicalStr()] = None return ReturnCodes.kOk
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("simulation", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-fans", "qt-pltf-fans")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("system-defaults", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-fans", "qt-pltf-fans")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("fans", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-fans", "qt-pltf-fans")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("platform", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform", "qt-pltf")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath (self, kid , toys , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() ancestorVal = Value() ancestorVal.setString(toys); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("toys", "http://qwilt.com/model/family", "family")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(kid); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("kid", "http://qwilt.com/model/family", "family")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("neighbors", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-network-ipv6", "qt-net-ip6")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("system-defaults", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-network-ipv6", "qt-net-ip6")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("ipv6", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-network-ipv6", "qt-net-ip6")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("network", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-network", "qt-net")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("hosts", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("static", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("name-resolution", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("system", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _collectItemsToDelete (self, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.opVs.keys(): if self.opVs[key]: res = self.opVs[key]._collectItemsToDelete( key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log('collect-items-to-delete-opV-failed').errorFunc(): logFunc('opVObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath( None) xmlVal = Value() xmlVal.setXmlTag(("op-v", "http://qwilt.com/model/oper", "oper")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def _collectItemsToDelete(self, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.powerSupplys.keys(): if self.powerSupplys[key]: res = self.powerSupplys[key]._collectItemsToDelete( key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log( 'collect-items-to-delete-powerSupply-failed' ).errorFunc(): logFunc( 'powerSupplyObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath(None) xmlVal = Value() xmlVal.setXmlTag(( "power-supply", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-power", "qt-pltf-pwr")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def readListKeys(self, trxContext=None): self.myInitGuard.isInitOrCrash() for logFunc in self._log('read-list-keys').debug3Func(): logFunc('called') # clear the old map self.configPs = {} self.configPKeys = [] keyPath = self._getSelfKeyPath(None) xmlVal = Value() xmlVal.setXmlTag(("config-p", "http://qwilt.com/model/oper", "oper")) keyPath.addKeyPathPostfix(xmlVal) keys = [] res = self.domain.readMaapiKeys(keyPath, keys, trxContext) if res != ReturnCodes.kOk: for logFunc in self._log( 'read-list-keys-domain-failed').errorFunc(): logFunc('domain.readMaapiKeys() failed') return ReturnCodes.kGeneralError for key in keys: self.configPKeys.append(key.getCannonicalStr()) self.configPs[key.getCannonicalStr()] = None return ReturnCodes.kOk
def _getSelfKeyPath(self, alien, junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() ancestorVal = Value() ancestorVal.setString(alien) keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(( "alien", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(( "root", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _collectItemsToDelete (self, line, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.queueGroups.keys(): if self.queueGroups[key]: res = self.queueGroups[key]._collectItemsToDelete(line, key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log('collect-items-to-delete-queueGroup-failed').errorFunc(): logFunc('queueGroupObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath(line, None) xmlVal = Value() xmlVal.setXmlTag(("queue-group", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line", "qtc-line")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def _getSelfKeyPath (self, linux_ , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS. junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() ancestorVal = Value() ancestorVal.setString(linux_); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("linux", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-linux", "qt-lnx")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _collectItemsToDelete(self, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.persons.keys(): if self.persons[key]: res = self.persons[key]._collectItemsToDelete( key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log( 'collect-items-to-delete-person-failed').errorFunc( ): logFunc( 'personObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath(None) xmlVal = Value() xmlVal.setXmlTag(( "people", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/generator-test", "le")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def _collectItemsToDelete (self, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.aliens.keys(): if self.aliens[key]: res = self.aliens[key]._collectItemsToDelete( key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log('collect-items-to-delete-alien-failed').errorFunc(): logFunc('alienObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath( None) xmlVal = Value() xmlVal.setXmlTag(("alien", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def _collectItemsToDelete (self, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.kids.keys(): if self.kids[key]: res = self.kids[key]._collectItemsToDelete( key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log('collect-items-to-delete-kid-failed').errorFunc(): logFunc('kidObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath( None) xmlVal = Value() xmlVal.setXmlTag(("kid", "http://qwilt.com/model/family", "family")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def readListKeys(self, trxContext=None): self.myInitGuard.isInitOrCrash() for logFunc in self._log('read-list-keys').debug3Func(): logFunc('called') # clear the old map self.persons = {} self.personKeys = [] keyPath = self._getSelfKeyPath(None) xmlVal = Value() xmlVal.setXmlTag(( "people", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/generator-test", "le")) keyPath.addKeyPathPostfix(xmlVal) keys = [] res = self.domain.readMaapiKeys(keyPath, keys, trxContext) if res != ReturnCodes.kOk: for logFunc in self._log( 'read-list-keys-domain-failed').errorFunc(): logFunc('domain.readMaapiKeys() failed') return ReturnCodes.kGeneralError for key in keys: self.personKeys.append(key.getCannonicalStr()) self.persons[key.getCannonicalStr()] = None return ReturnCodes.kOk
def _collectItemsToDelete (self, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.lists.keys(): if self.lists[key]: res = self.lists[key]._collectItemsToDelete( key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log('collect-items-to-delete-list-failed').errorFunc(): logFunc('listObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath( None) xmlVal = Value() xmlVal.setXmlTag(("list", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-alarms", "qt-sys-alarms")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setInt64(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def _collectItemsToDelete(self, rule, itemsToDelete): self.myInitGuard.isInitOrCrash() for logFunc in self._log('collect-items-to-delete').debug3Func(): logFunc('called: itemsToDelete=%s. PARAMS', itemsToDelete) for key in self.sourceZones.keys(): if self.sourceZones[key]: res = self.sourceZones[key]._collectItemsToDelete( rule, key, itemsToDelete) if res != ReturnCodes.kOk: for logFunc in self._log( 'collect-items-to-delete-sourceZone-failed' ).errorFunc(): logFunc( 'sourceZoneObj._collectItemsToDelete() failed. key=%s. PARAMS', key) return ReturnCodes.kGeneralError else: keyPath = self._getSelfKeyPath(rule, None) xmlVal = Value() xmlVal.setXmlTag( ("source-zone", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content", "qtc")) keyPath.addKeyPathPostfix(xmlVal) valKey = Value() valKey.setString(key) keyPath.addKeyPathPostfix(valKey) itemsToDelete.append(keyPath) for logFunc in self._log('collect-items-to-delete-done').debug3Func(): logFunc('done: itemsToDelete=%s. PARAMS', itemsToDelete) return ReturnCodes.kOk
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("counters", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-network-ipv6", "qt-net-ip6")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("status", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-fans", "qt-pltf-fans")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("alarm", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-reporting", "qtc-report")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("continuous-counters-32bit", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces", "qt-if")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("counters", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("op-r", "http://qwilt.com/model/oper", "oper")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("actual", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-module", "qt-strg-module")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def getOperRelativePath (self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(("design", "http://qwilt.com/model/lake-example", "lake-example")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def s_create (cls, logger, table, fish_, domain): __pychecker__="no-argsused" logger('s-create-blinkyfish').info('called. domain=%s, _validationPointId=%s, _actionPointId=%s', domain, BlinkyFish._validationPointId, BlinkyFish._actionPointId) confd_key=KeyPath() ancestorVal = Value() ancestorVal.setString(fish_); confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("fish", "http://qwilt.com/model/room", "room")) confd_key.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(table); confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("table", "http://qwilt.com/model/room", "room")) confd_key.addKeyPathPrefix(xmlVal) newNode=BlinkyFish(logger) logger("s-create-keypath").info("confd_key=%s", confd_key) newNode.setParent(None) newNode.setKeyPath(confd_key) newNode.setDomain(domain) res = newNode.internalInit() if (res != ReturnCodes.kOk): logger("s-create-internal-init-failed")\ .error("internalInit() failed. confd_key=%s", confd_key) if newNode._validationPointId: res = domain.registerValidationPoint(newNode._validationPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-validation-node--failed")\ .error("registerValidationNode(%s) failed", newNode._validationPointId) return None newNode.validateRegistrationDone = True if newNode._actionPointId: res = domain.registerActionPoint(newNode._actionPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-action-node--failed")\ .error("registerActionNode(%s) failed", newNode._actionPointId) return None newNode.actionRegistrationDone = True return newNode
def s_create(cls, logger, alien, domain): __pychecker__ = "no-argsused" logger('s-create-blinkyalien').info( 'called. domain=%s, _validationPointId=%s, _actionPointId=%s', domain, BlinkyAlien._validationPointId, BlinkyAlien._actionPointId) confd_key = KeyPath() ancestorVal = Value() ancestorVal.setString(alien) confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(( "alien", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) confd_key.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(( "root", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) confd_key.addKeyPathPrefix(xmlVal) newNode = BlinkyAlien(logger) logger("s-create-keypath").info("confd_key=%s", confd_key) newNode.setParent(None) newNode.setKeyPath(confd_key) newNode.setDomain(domain) res = newNode.internalInit() if (res != ReturnCodes.kOk): logger("s-create-internal-init-failed")\ .error("internalInit() failed. confd_key=%s", confd_key) if newNode._validationPointId: res = domain.registerValidationPoint(newNode._validationPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-validation-node--failed")\ .error("registerValidationNode(%s) failed", newNode._validationPointId) return None newNode.validateRegistrationDone = True if newNode._actionPointId: res = domain.registerActionPoint(newNode._actionPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-action-node--failed")\ .error("registerActionNode(%s) failed", newNode._actionPointId) return None newNode.actionRegistrationDone = True return newNode
def s_create(cls, logger, loggerClass, domain): __pychecker__ = "no-argsused" logger('s-create-blinkyloggerclass').info( 'called. domain=%s, _validationPointId=%s, _actionPointId=%s', domain, BlinkyLoggerClass._validationPointId, BlinkyLoggerClass._actionPointId) confd_key = KeyPath() ancestorVal = Value() ancestorVal.setString(loggerClass) confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("logger-class", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-debug", "qt-debug")) confd_key.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag( ("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) confd_key.addKeyPathPrefix(xmlVal) newNode = BlinkyLoggerClass(logger) logger("s-create-keypath").info("confd_key=%s", confd_key) newNode.setParent(None) newNode.setKeyPath(confd_key) newNode.setDomain(domain) res = newNode.internalInit() if (res != ReturnCodes.kOk): logger("s-create-internal-init-failed")\ .error("internalInit() failed. confd_key=%s", confd_key) if newNode._validationPointId: res = domain.registerValidationPoint(newNode._validationPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-validation-node--failed")\ .error("registerValidationNode(%s) failed", newNode._validationPointId) return None newNode.validateRegistrationDone = True if newNode._actionPointId: res = domain.registerActionPoint(newNode._actionPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-action-node--failed")\ .error("registerActionNode(%s) failed", newNode._actionPointId) return None newNode.actionRegistrationDone = True return newNode
def _getSelfKeyPath(self, linux_, variableCollection, variable, junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag( ("system-defaults", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-linux-variables", "qt-lnx-variables")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(variable) keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("variable", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-linux-variables", "qt-lnx-variables")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(variableCollection) keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("variable-collection", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-linux-variables", "qt-lnx-variables")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(linux_) keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("linux", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-linux", "qt-lnx")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag( ("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath(self, junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("base", "http://qwilt.com/model/benchmark", "bnch")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def s_create(cls, logger, orderedList, domain): __pychecker__ = "no-argsused" logger('s-create-blinkyorderedlist').info( 'called. domain=%s, _validationPointId=%s, _actionPointId=%s', domain, BlinkyOrderedList._validationPointId, BlinkyOrderedList._actionPointId) confd_key = KeyPath() ancestorVal = Value() ancestorVal.setString(orderedList) confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("ordered-list", "http://qwilt.com/model/lake-example", "lake-example")) confd_key.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag( ("list-ordered-by-user", "http://qwilt.com/model/lake-example", "lake-example")) confd_key.addKeyPathPrefix(xmlVal) newNode = BlinkyOrderedList(logger) logger("s-create-keypath").info("confd_key=%s", confd_key) newNode.setParent(None) newNode.setKeyPath(confd_key) newNode.setDomain(domain) res = newNode.internalInit() if (res != ReturnCodes.kOk): logger("s-create-internal-init-failed")\ .error("internalInit() failed. confd_key=%s", confd_key) if newNode._validationPointId: res = domain.registerValidationPoint(newNode._validationPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-validation-node--failed")\ .error("registerValidationNode(%s) failed", newNode._validationPointId) return None newNode.validateRegistrationDone = True if newNode._actionPointId: res = domain.registerActionPoint(newNode._actionPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-action-node--failed")\ .error("registerActionNode(%s) failed", newNode._actionPointId) return None newNode.actionRegistrationDone = True return newNode
def _getSelfKeyPath(self, loggerClass, instance, destination, junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag( ("output", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-debug", "qt-debug")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(destination) keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("destination", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-debug", "qt-debug")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(instance) keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("instance", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-debug", "qt-debug")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(loggerClass) keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag( ("logger-class", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-debug", "qt-debug")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag( ("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def s_create(cls, logger, table, fish_, domain): __pychecker__ = "no-argsused" logger('s-create-blinkyfish').info( 'called. domain=%s, _validationPointId=%s, _actionPointId=%s', domain, BlinkyFish._validationPointId, BlinkyFish._actionPointId) confd_key = KeyPath() ancestorVal = Value() ancestorVal.setString(fish_) confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("fish", "http://qwilt.com/model/room", "room")) confd_key.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(table) confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("table", "http://qwilt.com/model/room", "room")) confd_key.addKeyPathPrefix(xmlVal) newNode = BlinkyFish(logger) logger("s-create-keypath").info("confd_key=%s", confd_key) newNode.setParent(None) newNode.setKeyPath(confd_key) newNode.setDomain(domain) res = newNode.internalInit() if (res != ReturnCodes.kOk): logger("s-create-internal-init-failed")\ .error("internalInit() failed. confd_key=%s", confd_key) if newNode._validationPointId: res = domain.registerValidationPoint(newNode._validationPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-validation-node--failed")\ .error("registerValidationNode(%s) failed", newNode._validationPointId) return None newNode.validateRegistrationDone = True if newNode._actionPointId: res = domain.registerActionPoint(newNode._actionPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-action-node--failed")\ .error("registerActionNode(%s) failed", newNode._actionPointId) return None newNode.actionRegistrationDone = True return newNode
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("chair", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example", "se")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("generation-dummy", "http://qwilt.com/model/oper", "oper")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def getOperRelativePath(self, operRelativePath): for logFunc in self._log("get-oper-relative-path").debug3Func(): logFunc("called") val = Value() val.setXmlTag(( "alarm", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-reporting", "qtc-report")) operRelativePath.addKeyPathPostfix(val) for logFunc in self._log("getOperRelativePath-done").debug3Func(): logFunc("done. operRelativePath=%s", operRelativePath)
def _getSelfKeyPath (self , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("list-ordered-by-user", "http://qwilt.com/model/lake-example", "lake-example")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def s_create (cls, logger, orderedList, domain): __pychecker__="no-argsused" logger('s-create-blinkyorderedlist').info('called. domain=%s, _validationPointId=%s, _actionPointId=%s', domain, BlinkyOrderedList._validationPointId, BlinkyOrderedList._actionPointId) confd_key=KeyPath() ancestorVal = Value() ancestorVal.setString(orderedList); confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("ordered-list", "http://qwilt.com/model/lake-example", "lake-example")) confd_key.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("list-ordered-by-user", "http://qwilt.com/model/lake-example", "lake-example")) confd_key.addKeyPathPrefix(xmlVal) newNode=BlinkyOrderedList(logger) logger("s-create-keypath").info("confd_key=%s", confd_key) newNode.setParent(None) newNode.setKeyPath(confd_key) newNode.setDomain(domain) res = newNode.internalInit() if (res != ReturnCodes.kOk): logger("s-create-internal-init-failed")\ .error("internalInit() failed. confd_key=%s", confd_key) if newNode._validationPointId: res = domain.registerValidationPoint(newNode._validationPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-validation-node--failed")\ .error("registerValidationNode(%s) failed", newNode._validationPointId) return None newNode.validateRegistrationDone = True if newNode._actionPointId: res = domain.registerActionPoint(newNode._actionPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-action-node--failed")\ .error("registerActionNode(%s) failed", newNode._actionPointId) return None newNode.actionRegistrationDone = True return newNode
def _getSelfKeyPath (self, line , queueGroup , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS. junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() ancestorVal = Value() ancestorVal.setString(queueGroup); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("queue-group", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line", "qtc-line")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("dispatcher", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line", "qtc-line")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(line); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("line", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line", "qtc-line")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("content", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content", "qtc")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def s_create (cls, logger, loggerClass, domain): __pychecker__="no-argsused" logger('s-create-blinkyloggerclass').info('called. domain=%s, _validationPointId=%s, _actionPointId=%s', domain, BlinkyLoggerClass._validationPointId, BlinkyLoggerClass._actionPointId) confd_key=KeyPath() ancestorVal = Value() ancestorVal.setString(loggerClass); confd_key.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("logger-class", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-debug", "qt-debug")) confd_key.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) confd_key.addKeyPathPrefix(xmlVal) newNode=BlinkyLoggerClass(logger) logger("s-create-keypath").info("confd_key=%s", confd_key) newNode.setParent(None) newNode.setKeyPath(confd_key) newNode.setDomain(domain) res = newNode.internalInit() if (res != ReturnCodes.kOk): logger("s-create-internal-init-failed")\ .error("internalInit() failed. confd_key=%s", confd_key) if newNode._validationPointId: res = domain.registerValidationPoint(newNode._validationPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-validation-node--failed")\ .error("registerValidationNode(%s) failed", newNode._validationPointId) return None newNode.validateRegistrationDone = True if newNode._actionPointId: res = domain.registerActionPoint(newNode._actionPointId, newNode) if (res != ReturnCodes.kOk): logger("s-create-register-action-node--failed")\ .error("registerActionNode(%s) failed", newNode._actionPointId) return None newNode.actionRegistrationDone = True return newNode
def _getSelfKeyPath (self, alien , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("counters", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("status-wrapper", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(alien); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("alien", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("root", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath(self, junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag( ("list-ordered-by-user", "http://qwilt.com/model/lake-example", "lake-example")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath (self, module , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() xmlVal = Value() xmlVal.setXmlTag(("system-defaults", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-module", "qt-strg-module")) keyPath.addKeyPathPrefix(xmlVal) ancestorVal = Value() ancestorVal.setString(module); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("module", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-module", "qt-strg-module")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("storage", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage", "qt-strg")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath
def _getSelfKeyPath (self, source , junkForTemplate): for logFunc in self._log('get-self-key-path').debug3Func(): logFunc('called. PARAMS, junkForTemplate=%s', junkForTemplate) keyPath = KeyPath() ancestorVal = Value() ancestorVal.setString(source); keyPath.addKeyPathPrefix(ancestorVal) xmlVal = Value() xmlVal.setXmlTag(("source", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager", "qt-pltf-mngr")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("manager", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager", "qt-pltf-mngr")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("platform", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform", "qt-pltf")) keyPath.addKeyPathPrefix(xmlVal) xmlVal = Value() xmlVal.setXmlTag(("tech", "http://qwilt.com/ns/yang/device/tech/qwilt-tech", "qt")) keyPath.addKeyPathPrefix(xmlVal) for logFunc in self._log('get-self-key-path-done').debug3Func(): logFunc('done. keyPath=%s. PARAMS', keyPath) return keyPath