Exemplo n.º 1
0
    def fillTagValuesOpY (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values-opy").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        if operData.isOpYRequested() and operData.hasOpY():
            valBegin = Value()
            valBegin.setXmlBegin("op-y", "http://qwilt.com/model/oper", "oper")
            tagValueList.push(("op-y", "http://qwilt.com/model/oper"), valBegin)

            res = self.myOpY.fillTagValues(keyPath, tagValueList, operData.myOpY)
            if res != ReturnCodes.kOk:
                for logFunc in self._log("fill-tag-values-opy-my-internal-failed").errorFunc(): logFunc(
                    "myOpY->fillTagValues() failed. operData=%s, keyPath=%s, initialListSize=%d, tagValueList.getLen()=%d", 
                    operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
                while tagValueList.getLen() > initialListSize:
                    tagValueList.pop()
                return ReturnCodes.kGeneralError
            if tagValueList.getLen() == (initialListSize+1):
                # no values were added by opy - rollback the xmltag added
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd("op-y", "http://qwilt.com/model/oper", "oper")
                tagValueList.push(("op-y", "http://qwilt.com/model/oper"), valEnd)

        for logFunc in self._log("fill-tag-values-opy-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 2
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isEnabledRequested():
            valEnabled = Value()
            valEnabled.setEmpty()
            tagValueList.push(("enabled", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"), valEnabled)
        

        
        if self.controllerObj:
            valBegin = Value()
            (tag, ns, prefix) = ("controller" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line", "qtc-line")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.controllerObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-controller-failed').errorFunc(): logFunc('controllerObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.instancess.keys():
            if self.instancess[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("instances", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-pre-topper", "qtc-pt")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setString(key)
                tagValueList.push(("instance", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-pre-topper"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.instancess[key]._fillWriteTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-write-tag-values-instances-failed').errorFunc(): logFunc('instances._fillWriteTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 4
0
    def fillTagValues (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen())
                i+=1
        
        if operData.isOpValueDRequested() and operData.hasOpValueD():
            val = Value()
            val.setInt64(operData.opValueD)
            tagValueList.push(("op-value-d", "http://qwilt.com/model/oper"), val)
        
        
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i-=1

        for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 5
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.hosts.keys():
            if self.hosts[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("host", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setString(key)
                tagValueList.push(("hostname", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.hosts[key]._fillReadTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-read-tag-values-host-failed').errorFunc(): logFunc('host._fillReadTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 6
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isDefaultGatewayRequested():
            valDefaultGateway = Value()
            valDefaultGateway.setEmpty()
            tagValueList.push(("default-gateway", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), valDefaultGateway)
        

        
        if self.addressListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("address" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces", "qt-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.addressListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-address-failed').errorFunc(): logFunc('addressListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 7
0
    def fillTagValues (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen())
                i+=1
        
        if operData.isActualDeliveryInterfaceRequested() and operData.hasActualDeliveryInterface():
            val = Value()
            val.setString(operData.actualDeliveryInterface)
            tagValueList.push(("actual-delivery-interface", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-interfaces"), val)
        
        
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i-=1

        for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 8
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isIgnoreRequested():
            valIgnore = Value()
            valIgnore.setEmpty()
            tagValueList.push(("ignore", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content"), valIgnore)
        

        
        if self.actionObj:
            valBegin = Value()
            (tag, ns, prefix) = ("action" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content", "qtc")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.actionObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-action-failed').errorFunc(): logFunc('actionObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 9
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isDefaultGatewayRequested():
            valDefaultGateway = Value()
            valDefaultGateway.setEmpty()
            tagValueList.push(("default-gateway", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), valDefaultGateway)
        

        
        if self.addressListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("address" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces", "qt-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.addressListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-address-failed').errorFunc(): logFunc('addressListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        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
Exemplo n.º 11
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.configPs.keys():
            if self.configPs[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("config-p", "http://qwilt.com/model/oper", "oper")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setInt64(key)
                tagValueList.push(("id", "http://qwilt.com/model/oper"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.configPs[key]._fillReadTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-read-tag-values-configP-failed').errorFunc(): logFunc('configP._fillReadTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 12
0
    def _fillWriteTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.statusObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "status",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces",
                "qt-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-write-tag-values-status-failed').errorFunc():
                    logFunc('statusObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        if self.interfaceListObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "interface",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces",
                "qt-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.interfaceListObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-write-tag-values-interface-failed').errorFunc():
                    logFunc(
                        'interfaceListObj._fillWriteTagValues() failed. PARAMS'
                    )
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 13
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.export_s.keys():
            if self.export_s[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("export", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-reporting", "qtc-report")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setString(key)
                tagValueList.push(("name", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-reporting"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.export_s[key]._fillReadTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-read-tag-values-export_-failed').errorFunc(): logFunc('export_._fillReadTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 14
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isBestStudentRequested():
            valBestStudent = Value()
            valBestStudent.setEmpty()
            tagValueList.push(("best-student", "http://qwilt.com/model/school-example"), valBestStudent)
        

        
        if self.personListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("people" , "http://qwilt.com/model/school-example", "sche")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.personListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-people-failed').errorFunc(): logFunc('personListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 15
0
    def _fillReadTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.lllListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("lll", "http://qwilt.com/model/benchmark",
                                 "bnch")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.lllListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-lll-failed').errorFunc():
                    logFunc('lllListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 16
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.kids.keys():
            if self.kids[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("kid", "http://qwilt.com/model/family", "family")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setString(key)
                tagValueList.push(("name", "http://qwilt.com/model/family"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.kids[key]._fillWriteTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-write-tag-values-kid-failed').errorFunc(): logFunc('kid._fillWriteTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 17
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.servers.keys():
            if self.servers[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("server", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setIPv4(key)
                tagValueList.push(("address", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.servers[key]._fillWriteTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-write-tag-values-server-failed').errorFunc(): logFunc('server._fillWriteTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 18
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        

        
        if self.destinationListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("destination" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-snmp", "qt-snmp")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.destinationListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-destination-failed').errorFunc(): logFunc('destinationListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 19
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        

        
        if self.applicationInitiatedDiscoveryObj:
            valBegin = Value()
            (tag, ns, prefix) = ("application-initiated-discovery" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-network-ipv6", "qt-net-ip6")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.applicationInitiatedDiscoveryObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-application-initiated-discovery-failed').errorFunc(): logFunc('applicationInitiatedDiscoveryObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 20
0
    def fillTagValuesOpD (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values-opd").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        if operData.isOpDRequested() and operData.hasOpD():
            valBegin = Value()
            valBegin.setXmlBegin("op-d", "http://qwilt.com/model/oper", "oper")
            tagValueList.push(("op-d", "http://qwilt.com/model/oper"), valBegin)

            res = self.myOpD.fillTagValues(keyPath, tagValueList, operData.myOpD)
            if res != ReturnCodes.kOk:
                for logFunc in self._log("fill-tag-values-opd-my-internal-failed").errorFunc(): logFunc(
                    "myOpD->fillTagValues() failed. operData=%s, keyPath=%s, initialListSize=%d, tagValueList.getLen()=%d", 
                    operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
                while tagValueList.getLen() > initialListSize:
                    tagValueList.pop()
                return ReturnCodes.kGeneralError
            if tagValueList.getLen() == (initialListSize+1):
                # no values were added by opd - rollback the xmltag added
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd("op-d", "http://qwilt.com/model/oper", "oper")
                tagValueList.push(("op-d", "http://qwilt.com/model/oper"), valEnd)

        for logFunc in self._log("fill-tag-values-opd-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 21
0
    def fillTagValues (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen())
                i+=1
        
        if operData.isLocationRequested() and operData.hasLocation():
            val = Value()
            val.setString(operData.location)
            tagValueList.push(("location", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-module"), val)
        
        
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i-=1

        for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        

        
        if self.orderedListListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("ordered-list" , "http://qwilt.com/model/lake-example", "lake-example")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.orderedListListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-ordered-list-failed').errorFunc(): logFunc('orderedListListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 23
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.testGenerationUnderscores.keys():
            if self.testGenerationUnderscores[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("test-generation_underscore", "http://qwilt.com/model/lake-example", "lake-example")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setString(key)
                tagValueList.push(("name", "http://qwilt.com/model/lake-example"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.testGenerationUnderscores[key]._fillReadTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-read-tag-values-testGenerationUnderscore-failed').errorFunc(): logFunc('testGenerationUnderscore._fillReadTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 24
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.opVs.keys():
            if self.opVs[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("op-v", "http://qwilt.com/model/oper", "oper")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setString(key)
                tagValueList.push(("value-op-v1", "http://qwilt.com/model/oper"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.opVs[key]._fillWriteTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-write-tag-values-opV-failed').errorFunc(): logFunc('opV._fillWriteTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 25
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isDummyRequested():
            valDummy = Value()
            valDummy.setEmpty()
            tagValueList.push(("dummy", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example"), valDummy)
        

        
        if self.countersObj:
            valBegin = Value()
            (tag, ns, prefix) = ("counters" , "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.countersObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-counters-failed').errorFunc(): logFunc('countersObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 26
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isHeightRequested():
            valHeight = Value()
            valHeight.setEmpty()
            tagValueList.push(("height", "http://qwilt.com/model/room"), valHeight)
        

        
        if self.partListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("parts" , "http://qwilt.com/model/room", "room")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.partListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-parts-failed').errorFunc(): logFunc('partListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
    def _fillReadTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.housekeeperObj:
            valBegin = Value()
            (tag, ns,
             prefix) = ("housekeeper",
                        "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log",
                        "qt-log")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.housekeeperObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-housekeeper-failed').errorFunc():
                    logFunc(
                        'housekeeperObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 28
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        

        
        if self.lllListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("lll" , "http://qwilt.com/model/benchmark", "bnch")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.lllListObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-lll-failed').errorFunc(): logFunc('lllListObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 29
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        for key in self.aliens.keys():
            if self.aliens[key]:
                valBegin = Value()
                (tag, ns, prefix) = ("alien", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example", "oe")
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)

                valKey = Value()
                valKey.setString(key)
                tagValueList.push(("name", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example"), valKey)

                tagValueListLen = tagValueList.getLen()

                res = self.aliens[key]._fillReadTagValues(tagValueList)
                if res != ReturnCodes.kOk:
                    for logFunc in self._log('fill-read-tag-values-alien-failed').errorFunc(): logFunc('alien._fillReadTagValues() failed. key=%s', key)
                    return ReturnCodes.kGeneralError

                if tagValueList.getLen() == tagValueListLen:
                    # descendant didn't add anything, no need to read it.
                    tagValueList.pop()
                    tagValueList.pop()
                else:
                    valEnd = Value()
                    valEnd.setXmlEnd((tag, ns, prefix))
                    tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 30
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasDummy():
            valDummy = Value()
            if self.dummy is not None:
                valDummy.setBool(self.dummy)
            else:
                valDummy.setEmpty()
            tagValueList.push(("dummy", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log"), valDummy)
        

        
        if self.thresholdsObj:
            valBegin = Value()
            (tag, ns, prefix) = ("thresholds" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log", "qt-log")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.thresholdsObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-thresholds-failed').errorFunc(): logFunc('thresholdsObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        
        if self.countersObj:
            valBegin = Value()
            (tag, ns, prefix) = ("counters" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log", "qt-log")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.countersObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-counters-failed').errorFunc(): logFunc('countersObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 31
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasHostname():
            valHostname = Value()
            if self.hostname is not None:
                valHostname.setString(self.hostname)
            else:
                valHostname.setEmpty()
            tagValueList.push(("hostname", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system"), valHostname)
        

        
        if self.systemDefaultsObj:
            valBegin = Value()
            (tag, ns, prefix) = ("system-defaults" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.systemDefaultsObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-system-defaults-failed').errorFunc(): logFunc('systemDefaultsObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        
        if self.nameResolutionObj:
            valBegin = Value()
            (tag, ns, prefix) = ("name-resolution" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.nameResolutionObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-name-resolution-failed').errorFunc(): logFunc('nameResolutionObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 32
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasEnabled():
            valEnabled = Value()
            if self.enabled is not None:
                valEnabled.setBool(self.enabled)
            else:
                valEnabled.setEmpty()
            tagValueList.push(("enabled", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system"), valEnabled)
        

        
        if self.nameServersObj:
            valBegin = Value()
            (tag, ns, prefix) = ("name-servers" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.nameServersObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-name-servers-failed').errorFunc(): logFunc('nameServersObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        
        if self.searchListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("search" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system", "qt-sys")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.searchListObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-search-failed').errorFunc(): logFunc('searchListObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 33
0
    def _fillReadTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.isType_Requested():
            valType_ = Value()
            valType_.setEmpty()
            tagValueList.push(
                ("type",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valType_)

        if self.isEnabledRequested():
            valEnabled = Value()
            valEnabled.setEmpty()
            tagValueList.push(
                ("enabled",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valEnabled)

        if self.isNameRequested():
            valName = Value()
            valName.setEmpty()
            tagValueList.push(
                ("name",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valName)

        if self.systemDefaultsObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "system-defaults",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line",
                "qtc-line")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.systemDefaultsObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-system-defaults-failed'
                ).errorFunc():
                    logFunc(
                        'systemDefaultsObj._fillReadTagValues() failed. PARAMS'
                    )
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 34
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasPreferredDeliveryInterface():
            valPreferredDeliveryInterface = Value()
            if self.preferredDeliveryInterface is not None:
                valPreferredDeliveryInterface.setString(self.preferredDeliveryInterface)
            else:
                valPreferredDeliveryInterface.setEmpty()
            tagValueList.push(("preferred-delivery-interface", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-interfaces"), valPreferredDeliveryInterface)
        

        
        if self.ipv4Obj:
            valBegin = Value()
            (tag, ns, prefix) = ("ipv4" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-interfaces", "qtc-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.ipv4Obj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-ipv4-failed').errorFunc(): logFunc('ipv4Obj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        
        if self.ipv6Obj:
            valBegin = Value()
            (tag, ns, prefix) = ("ipv6" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-interfaces", "qtc-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.ipv6Obj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-ipv6-failed').errorFunc(): logFunc('ipv6Obj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 35
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasMethod():
            valMethod = Value()
            if self.method is not None:
                valMethod.setEnum(self.method.getValue())
            else:
                valMethod.setEmpty()
            tagValueList.push(("method", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces"), valMethod)
        

        
        if self.arpObj:
            valBegin = Value()
            (tag, ns, prefix) = ("arp" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces", "qt-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.arpObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-arp-failed').errorFunc(): logFunc('arpObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        
        if self.pingObj:
            valBegin = Value()
            (tag, ns, prefix) = ("ping" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-interfaces", "qt-if")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.pingObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-ping-failed').errorFunc(): logFunc('pingObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 36
0
    def fillTagValues(self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func():
            logFunc("called. operData=%s, keyPath=%s, initialListSize=%d",
                    operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log(
                        "fill-tag-values-adding").debug3Func():
                    logFunc(
                        "adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d",
                        i, valBegin, self.myKeyPath.getLen())
                i += 1

        if operData.isColorRequested() and operData.hasColor():
            val = Value()
            val.setEnum(operData.color.getValue())
            tagValueList.push(("color", "http://qwilt.com/model/lake-example"),
                              val)

        if operData.isPatternRequested() and operData.hasPattern():
            val = Value()
            val.setString(operData.pattern)
            tagValueList.push(
                ("pattern", "http://qwilt.com/model/lake-example"), val)

        if operData.isMacAddressRequested() and operData.hasMacAddress():
            val = Value()
            val.setBinary(operData.macAddress.getAddress())
            tagValueList.push(
                ("mac-address", "http://qwilt.com/model/lake-example"), val)

        if operData.isLineWidthRequested() and operData.hasLineWidth():
            val = Value()
            val.setInt8(operData.lineWidth)
            tagValueList.push(
                ("line-width", "http://qwilt.com/model/lake-example"), val)

        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i -= 1

        for logFunc in self._log("fill-tag-values-ended").debug3Func():
            logFunc(
                "ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                operData.debugStr(True), keyPath, initialListSize,
                tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 37
0
    def _fillReadTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.isValueOpV1Requested():
            valValueOpV1 = Value()
            valValueOpV1.setEmpty()
            tagValueList.push(("value-op-v1", "http://qwilt.com/model/oper"),
                              valValueOpV1)

        if self.opYObj:
            valBegin = Value()
            (tag, ns, prefix) = ("op-y", "http://qwilt.com/model/oper", "oper")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.opYObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-op-y-failed').errorFunc():
                    logFunc('opYObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        if self.opWObj:
            valBegin = Value()
            (tag, ns, prefix) = ("op-w", "http://qwilt.com/model/oper", "oper")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.opWObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-op-w-failed').errorFunc():
                    logFunc('opWObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 38
0
    def fillTagValues (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen())
                i+=1
        
        if operData.isUuidRequested() and operData.hasUuid():
            val = Value()
            val.setString(operData.uuid)
            tagValueList.push(("uuid", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), val)
        
        if operData.isOperationalStatusRequested() and operData.hasOperationalStatus():
            val = Value()
            val.setEnum(operData.operationalStatus.getValue())
            tagValueList.push(("operational-status", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), val)
        
        if operData.isFileSystemTypeRawRequested() and operData.hasFileSystemTypeRaw():
            val = Value()
            val.setString(operData.fileSystemTypeRaw)
            tagValueList.push(("file-system-type-raw", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), val)
        
        if operData.isFileSystemTypeRequested() and operData.hasFileSystemType():
            val = Value()
            val.setEnum(operData.fileSystemType.getValue())
            tagValueList.push(("file-system-type", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), val)
        
        if operData.isExpectedUuidRequested() and operData.hasExpectedUuid():
            val = Value()
            val.setString(operData.expectedUuid)
            tagValueList.push(("expected-uuid", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), val)
        
        if operData.isOperationalStatusReasonRequested() and operData.hasOperationalStatusReason():
            val = Value()
            val.setEnum(operData.operationalStatusReason.getValue())
            tagValueList.push(("operational-status-reason", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), val)
        
        
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i-=1

        for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 39
0
    def fillTagValues (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen())
                i+=1
        
        if operData.isActiveSecondsRequested() and operData.hasActiveSeconds():
            val = Value()
            val.setInt64(operData.activeSeconds)
            tagValueList.push(("active-seconds", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log"), val)
        
        if operData.isTotalSecondsRequested() and operData.hasTotalSeconds():
            val = Value()
            val.setInt64(operData.totalSeconds)
            tagValueList.push(("total-seconds", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log"), val)
        
        if operData.isPollsRequested() and operData.hasPolls():
            val = Value()
            val.setInt64(operData.polls)
            tagValueList.push(("polls", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log"), val)
        
        if operData.isPollsMissedRequested() and operData.hasPollsMissed():
            val = Value()
            val.setInt64(operData.pollsMissed)
            tagValueList.push(("polls-missed", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log"), val)
        
        if operData.isPollLatencyWarningsRequested() and operData.hasPollLatencyWarnings():
            val = Value()
            val.setInt64(operData.pollLatencyWarnings)
            tagValueList.push(("poll-latency-warnings", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log"), val)
        
        if operData.isPollLatencyErrorsRequested() and operData.hasPollLatencyErrors():
            val = Value()
            val.setInt64(operData.pollLatencyErrors)
            tagValueList.push(("poll-latency-errors", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-log"), val)
        
        
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i-=1

        for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 40
0
    def _fillWriteTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.hasName():
            valName = Value()
            if self.name is not None:
                valName.setString(self.name)
            else:
                valName.setEmpty()
            tagValueList.push((
                "name",
                "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example"
            ), valName)

        if self.hasHeight():
            valHeight = Value()
            if self.height is not None:
                valHeight.setInt64(self.height)
            else:
                valHeight.setEmpty()
            tagValueList.push((
                "height",
                "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example"
            ), valHeight)

        if self.statusWrapperObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "status-wrapper",
                "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/oper-example",
                "oe")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusWrapperObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-write-tag-values-status-wrapper-failed'
                ).errorFunc():
                    logFunc(
                        'statusWrapperObj._fillWriteTagValues() failed. PARAMS'
                    )
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 41
0
    def fillTagValues (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen())
                i+=1
        
        if operData.isSilentDroppedPacketsRequested() and operData.hasSilentDroppedPackets():
            val = Value()
            val.setInt64(operData.silentDroppedPackets)
            tagValueList.push(("silent-dropped-packets", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-snmp"), val)
        
        if operData.isInPacketsRequested() and operData.hasInPackets():
            val = Value()
            val.setInt64(operData.inPackets)
            tagValueList.push(("in-packets", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-snmp"), val)
        
        if operData.isInBadVersionPacketsRequested() and operData.hasInBadVersionPackets():
            val = Value()
            val.setInt64(operData.inBadVersionPackets)
            tagValueList.push(("in-bad-version-packets", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-snmp"), val)
        
        if operData.isInBadCommunityUsePacketsRequested() and operData.hasInBadCommunityUsePackets():
            val = Value()
            val.setInt64(operData.inBadCommunityUsePackets)
            tagValueList.push(("in-bad-community-use-packets", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-snmp"), val)
        
        if operData.isInAsnParseErrorsRequested() and operData.hasInAsnParseErrors():
            val = Value()
            val.setInt64(operData.inAsnParseErrors)
            tagValueList.push(("in-asn-parse-errors", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-snmp"), val)
        
        if operData.isInBadCommunityPacketsRequested() and operData.hasInBadCommunityPackets():
            val = Value()
            val.setInt64(operData.inBadCommunityPackets)
            tagValueList.push(("in-bad-community-packets", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-snmp"), val)
        
        
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i-=1

        for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 42
0
    def fillTagValues (self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func(): logFunc("called. operData=%s, keyPath=%s, initialListSize=%d", operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log("fill-tag-values-adding").debug3Func(): logFunc("adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d", i, valBegin, self.myKeyPath.getLen())
                i+=1
        
        if operData.isCommandWarningTimeoutsRequested() and operData.hasCommandWarningTimeouts():
            val = Value()
            val.setInt64(operData.commandWarningTimeouts)
            tagValueList.push(("command-warning-timeouts", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager"), val)
        
        if operData.isCommandErrorsRequested() and operData.hasCommandErrors():
            val = Value()
            val.setInt64(operData.commandErrors)
            tagValueList.push(("command-errors", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager"), val)
        
        if operData.isFileErrorsRequested() and operData.hasFileErrors():
            val = Value()
            val.setInt64(operData.fileErrors)
            tagValueList.push(("file-errors", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager"), val)
        
        if operData.isReadsRequested() and operData.hasReads():
            val = Value()
            val.setInt64(operData.reads)
            tagValueList.push(("reads", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager"), val)
        
        if operData.isParsingErrorsRequested() and operData.hasParsingErrors():
            val = Value()
            val.setInt64(operData.parsingErrors)
            tagValueList.push(("parsing-errors", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager"), val)
        
        if operData.isCommandTimeoutsRequested() and operData.hasCommandTimeouts():
            val = Value()
            val.setInt64(operData.commandTimeouts)
            tagValueList.push(("command-timeouts", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-manager"), val)
        
        
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i-=1

        for logFunc in self._log("fill-tag-values-ended").debug3Func(): logFunc("ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                                                  operData.debugStr(True), keyPath, initialListSize, tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 43
0
    def _fillWriteTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.hasTrimContentItemSizeMb():
            valTrimContentItemSizeMb = Value()
            if self.trimContentItemSizeMb is not None:
                valTrimContentItemSizeMb.setInt64(self.trimContentItemSizeMb)
            else:
                valTrimContentItemSizeMb.setEmpty()
            tagValueList.push(
                ("trim-content-item-size-mb",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valTrimContentItemSizeMb)

        if self.hasName():
            valName = Value()
            if self.name is not None:
                valName.setString(self.name)
            else:
                valName.setEmpty()
            tagValueList.push(
                ("name",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valName)

        if self.systemDefaultsObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "system-defaults",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line",
                "qtc-line")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.systemDefaultsObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-write-tag-values-system-defaults-failed'
                ).errorFunc():
                    logFunc(
                        'systemDefaultsObj._fillWriteTagValues() failed. PARAMS'
                    )
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 44
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isOpValueBRequested():
            valOpValueB = Value()
            valOpValueB.setEmpty()
            tagValueList.push(("op-value-b", "http://qwilt.com/model/oper"), valOpValueB)
        

        
        if self.opCListObj:
            valBegin = Value()
            (tag, ns, prefix) = ("op-c" , "http://qwilt.com/model/oper", "oper")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.opCListObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-op-c-failed').errorFunc(): logFunc('opCListObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        
        if self.opDObj:
            valBegin = Value()
            (tag, ns, prefix) = ("op-d" , "http://qwilt.com/model/oper", "oper")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.opDObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-op-d-failed').errorFunc(): logFunc('opDObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 45
0
    def _fillReadTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.isMaxActiveConnectionsRequested():
            valMaxActiveConnections = Value()
            valMaxActiveConnections.setEmpty()
            tagValueList.push(
                ("max-active-connections",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valMaxActiveConnections)

        if self.isEnabledRequested():
            valEnabled = Value()
            valEnabled.setEmpty()
            tagValueList.push(
                ("enabled",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valEnabled)

        if self.isMaxRedirectRateRequested():
            valMaxRedirectRate = Value()
            valMaxRedirectRate.setEmpty()
            tagValueList.push(
                ("max-redirect-rate",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"
                 ), valMaxRedirectRate)

        if self.blockerObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "blocker",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line",
                "qtc-line")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.blockerObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-blocker-failed').errorFunc():
                    logFunc('blockerObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 46
0
    def _fillReadTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.isImplementationRequested():
            valImplementation = Value()
            valImplementation.setEmpty()
            tagValueList.push(
                ("implementation",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"
                 ), valImplementation)

        if self.isControllerRequested():
            valController = Value()
            valController.setEmpty()
            tagValueList.push(
                ("controller",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"
                 ), valController)

        if self.isIdRequested():
            valId = Value()
            valId.setEmpty()
            tagValueList.push(
                ("id",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"
                 ), valId)

        if self.statusObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "status",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk",
                "qt-strg-dsk")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-status-failed').errorFunc():
                    logFunc('statusObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
    def fillTagValues(self, keyPath, tagValueList, operData):
        initialListSize = tagValueList.getLen()
        for logFunc in self._log("fill-tag-values").debug3Func():
            logFunc("called. operData=%s, keyPath=%s, initialListSize=%d",
                    operData.debugStr(True), keyPath, initialListSize)
        # fill tag values up to current
        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = keyPath.getLen()
            while i < self.myKeyPath.getLen():
                valBegin = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valBegin.setXmlBegin((tag, ns, prefix))
                tagValueList.push((tag, ns), valBegin)
                for logFunc in self._log(
                        "fill-tag-values-adding").debug3Func():
                    logFunc(
                        "adding xml begin. i=%d, valBegin=%s, self.myKeyPath.getLen()=%d",
                        i, valBegin, self.myKeyPath.getLen())
                i += 1

        if operData.isIpValRequested() and operData.hasIpVal():
            val = Value()
            val.setIPv4(operData.ipVal)
            tagValueList.push(("ip-val", "http://qwilt.com/model/oper"), val)

        if operData.isIdRequested() and operData.hasId():
            val = Value()
            val.setInt64(operData.id)
            tagValueList.push(("id", "http://qwilt.com/model/oper"), val)

        if operData.isValRequested() and operData.hasVal():
            val = Value()
            val.setInt64(operData.val)
            tagValueList.push(("val", "http://qwilt.com/model/oper"), val)

        if operData.isIpPrefixValRequested() and operData.hasIpPrefixVal():
            val = Value()
            val.setIPv4Prefix(operData.ipPrefixVal)
            tagValueList.push(("ip-prefix-val", "http://qwilt.com/model/oper"),
                              val)

        if self.myKeyPath.isEqualLen(keyPath, keyPath.getLen()):
            i = self.myKeyPath.getLen() - 1
            while i >= keyPath.getLen():
                valEnd = Value()
                (tag, ns, prefix) = self.myKeyPath.getAt(i).asXmlTag()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
                i -= 1

        for logFunc in self._log("fill-tag-values-ended").debug3Func():
            logFunc(
                "ended. operData=%s, keyPath=%s, initialListSize=%d, finalListSize=%d",
                operData.debugStr(True), keyPath, initialListSize,
                tagValueList.getLen())
        return ReturnCodes.kOk
Exemplo n.º 48
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isTimezoneRequested():
            valTimezone = Value()
            valTimezone.setEmpty()
            tagValueList.push(("timezone", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-clock"), valTimezone)
        

        
        if self.statusObj:
            valBegin = Value()
            (tag, ns, prefix) = ("status" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-clock", "qt-sys-clock")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-status-failed').errorFunc(): logFunc('statusObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        
        if self.systemDefaultsObj:
            valBegin = Value()
            (tag, ns, prefix) = ("system-defaults" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-clock", "qt-sys-clock")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.systemDefaultsObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-system-defaults-failed').errorFunc(): logFunc('systemDefaultsObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 49
0
    def _fillReadTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.isColorRequested():
            valColor = Value()
            valColor.setEmpty()
            tagValueList.push((
                "color",
                "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example"
            ), valColor)

        if self.isPrettyRequested():
            valPretty = Value()
            valPretty.setEmpty()
            tagValueList.push((
                "pretty",
                "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example"
            ), valPretty)

        if self.isNumOfLegsRequested():
            valNumOfLegs = Value()
            valNumOfLegs.setEmpty()
            tagValueList.push((
                "num-of-legs",
                "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example"
            ), valNumOfLegs)

        if self.statusObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "status",
                "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example",
                "se")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-read-tag-values-status-failed').errorFunc():
                    logFunc('statusObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 50
0
    def _fillReadTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-read-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.isAutoInitRequested():
            valAutoInit = Value()
            valAutoInit.setEmpty()
            tagValueList.push(("auto-init", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), valAutoInit)
        
        if self.isOsDeviceRequested():
            valOsDevice = Value()
            valOsDevice.setEmpty()
            tagValueList.push(("os-device", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), valOsDevice)
        
        if self.isImplementationRequested():
            valImplementation = Value()
            valImplementation.setEmpty()
            tagValueList.push(("implementation", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), valImplementation)
        
        if self.isRaidTypeRequested():
            valRaidType = Value()
            valRaidType.setEmpty()
            tagValueList.push(("raid-type", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), valRaidType)
        
        if self.isNameRequested():
            valName = Value()
            valName.setEmpty()
            tagValueList.push(("name", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk"), valName)
        

        
        if self.statusObj:
            valBegin = Value()
            (tag, ns, prefix) = ("status" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-storage-disk", "qt-strg-dsk")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusObj._fillReadTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-read-tag-values-status-failed').errorFunc(): logFunc('statusObj._fillReadTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
    def _fillWriteTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.hasMuteReporting():
            valMuteReporting = Value()
            if self.muteReporting is not None:
                valMuteReporting.setBool(self.muteReporting)
            else:
                valMuteReporting.setEmpty()
            tagValueList.push((
                "mute-reporting",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-temperature"
            ), valMuteReporting)

        if self.hasEnabled():
            valEnabled = Value()
            if self.enabled is not None:
                valEnabled.setBool(self.enabled)
            else:
                valEnabled.setEmpty()
            tagValueList.push((
                "enabled",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-temperature"
            ), valEnabled)

        if self.simulationObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "simulation",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-temperature",
                "qt-pltf-temperature")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.simulationObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-write-tag-values-simulation-failed').errorFunc():
                    logFunc(
                        'simulationObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 52
0
    def _fillWriteTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.hasEnabled():
            valEnabled = Value()
            if self.enabled is not None:
                valEnabled.setBool(self.enabled)
            else:
                valEnabled.setEmpty()
            tagValueList.push(
                ("enabled",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-process"),
                valEnabled)

        if self.hasName():
            valName = Value()
            if self.name is not None:
                valName.setString(self.name)
            else:
                valName.setEmpty()
            tagValueList.push(
                ("name",
                 "http://qwilt.com/ns/yang/device/tech/qwilt-tech-process"),
                valName)

        if self.executionObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "execution",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-process",
                "qt-proc")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.executionObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-write-tag-values-execution-failed').errorFunc():
                    logFunc(
                        'executionObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk
Exemplo n.º 53
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasMaxActiveConnections():
            valMaxActiveConnections = Value()
            if self.maxActiveConnections is not None:
                valMaxActiveConnections.setInt64(self.maxActiveConnections)
            else:
                valMaxActiveConnections.setEmpty()
            tagValueList.push(("max-active-connections", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"), valMaxActiveConnections)
        
        if self.hasEnabled():
            valEnabled = Value()
            if self.enabled is not None:
                valEnabled.setBool(self.enabled)
            else:
                valEnabled.setEmpty()
            tagValueList.push(("enabled", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"), valEnabled)
        
        if self.hasMaxRedirectRate():
            valMaxRedirectRate = Value()
            if self.maxRedirectRate is not None:
                valMaxRedirectRate.setInt64(self.maxRedirectRate)
            else:
                valMaxRedirectRate.setEmpty()
            tagValueList.push(("max-redirect-rate", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"), valMaxRedirectRate)
        

        
        if self.blockerObj:
            valBegin = Value()
            (tag, ns, prefix) = ("blocker" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line", "qtc-line")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.blockerObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-blocker-failed').errorFunc(): logFunc('blockerObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 54
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasColor():
            valColor = Value()
            if self.color is not None:
                valColor.setString(self.color)
            else:
                valColor.setEmpty()
            tagValueList.push(("color", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example"), valColor)
        
        if self.hasPretty():
            valPretty = Value()
            if self.pretty is not None:
                valPretty.setBool(self.pretty)
            else:
                valPretty.setEmpty()
            tagValueList.push(("pretty", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example"), valPretty)
        
        if self.hasNumOfLegs():
            valNumOfLegs = Value()
            if self.numOfLegs is not None:
                valNumOfLegs.setInt64(self.numOfLegs)
            else:
                valNumOfLegs.setEmpty()
            tagValueList.push(("num-of-legs", "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example"), valNumOfLegs)
        

        
        if self.statusObj:
            valBegin = Value()
            (tag, ns, prefix) = ("status" , "http://qwilt.com/ns/yang/ut/sys/blinky/example/python/simple-example", "se")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-status-failed').errorFunc(): logFunc('statusObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasEnabled():
            valEnabled = Value()
            if self.enabled is not None:
                valEnabled.setBool(self.enabled)
            else:
                valEnabled.setEmpty()
            tagValueList.push(("enabled", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-alarms"), valEnabled)
        
        if self.hasRaiseTestAlarm():
            valRaiseTestAlarm = Value()
            if self.raiseTestAlarm is not None:
                valRaiseTestAlarm.setBool(self.raiseTestAlarm)
            else:
                valRaiseTestAlarm.setEmpty()
            tagValueList.push(("raise-test-alarm", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-alarms"), valRaiseTestAlarm)
        
        if self.hasPollInterval():
            valPollInterval = Value()
            if self.pollInterval is not None:
                valPollInterval.setInt64(self.pollInterval)
            else:
                valPollInterval.setEmpty()
            tagValueList.push(("poll-interval", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-alarms"), valPollInterval)
        

        
        if self.thresholdsObj:
            valBegin = Value()
            (tag, ns, prefix) = ("thresholds" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-system-alarms", "qt-sys-alarms")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.thresholdsObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-thresholds-failed').errorFunc(): logFunc('thresholdsObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 56
0
    def _fillWriteTagValues (self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func(): logFunc('called: tagValueList=%s', tagValueList)

        
        if self.hasType_():
            valType_ = Value()
            if self.type_ is not None:
                valType_.setEnum(self.type_.getValue())
            else:
                valType_.setEmpty()
            tagValueList.push(("type", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"), valType_)
        
        if self.hasEnabled():
            valEnabled = Value()
            if self.enabled is not None:
                valEnabled.setBool(self.enabled)
            else:
                valEnabled.setEmpty()
            tagValueList.push(("enabled", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"), valEnabled)
        
        if self.hasName():
            valName = Value()
            if self.name is not None:
                valName.setString(self.name)
            else:
                valName.setEmpty()
            tagValueList.push(("name", "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line"), valName)
        

        
        if self.systemDefaultsObj:
            valBegin = Value()
            (tag, ns, prefix) = ("system-defaults" , "http://qwilt.com/ns/yang/device/tech/qwilt-tech-content-line", "qtc-line")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.systemDefaultsObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log('fill-write-tag-values-system-defaults-failed').errorFunc(): logFunc('systemDefaultsObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)
        

        return ReturnCodes.kOk
Exemplo n.º 57
0
    def _fillWriteTagValues(self, tagValueList):
        self.myInitGuard.isInitOrCrash()
        for logFunc in self._log('fill-write-tag-values').debug3Func():
            logFunc('called: tagValueList=%s', tagValueList)

        if self.hasId():
            valId = Value()
            if self.id is not None:
                valId.setString(self.id)
            else:
                valId.setEmpty()
            tagValueList.push((
                "id",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-power"
            ), valId)

        if self.hasFruId():
            valFruId = Value()
            if self.fruId is not None:
                valFruId.setString(self.fruId)
            else:
                valFruId.setEmpty()
            tagValueList.push((
                "fru-id",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-power"
            ), valFruId)

        if self.statusObj:
            valBegin = Value()
            (tag, ns, prefix) = (
                "status",
                "http://qwilt.com/ns/yang/device/tech/qwilt-tech-platform-power",
                "qt-pltf-pwr")
            valBegin.setXmlBegin((tag, ns, prefix))
            tagValueList.push((tag, ns), valBegin)

            tagValueListLen = tagValueList.getLen()

            res = self.statusObj._fillWriteTagValues(tagValueList)
            if res != ReturnCodes.kOk:
                for logFunc in self._log(
                        'fill-write-tag-values-status-failed').errorFunc():
                    logFunc('statusObj._fillWriteTagValues() failed. PARAMS')
                return ReturnCodes.kGeneralError

            if tagValueList.getLen() == tagValueListLen:
                # descendant didn't add anything, no need to read it.
                tagValueList.pop()
            else:
                valEnd = Value()
                valEnd.setXmlEnd((tag, ns, prefix))
                tagValueList.push((tag, ns), valEnd)

        return ReturnCodes.kOk