daemon/core/conf.py
def toconfmsg(cls, flags, nodenum, typeflags, values):
        ''' Convert this class to a Config API message. Some TLVs are defined
            by the class, but node number, conf type flags, and values must
            be passed in.
        '''
        keys = cls.getnames()
        keyvalues = map(lambda a,b: "%s=%s" % (a,b), keys, values)
        values_str = string.join(keyvalues, '|')
        tlvdata = ""
        if nodenum is not None:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_NODE,
                                                nodenum)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_OBJ,
                                            cls._name)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_TYPE,
                                            typeflags) 
        datatypes = tuple( map(lambda x: x[1], cls._confmatrix) )
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_DATA_TYPES,
                                            datatypes)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_VALUES,
                                            values_str)
        captions = reduce( lambda a,b: a + '|' + b, \
                           map(lambda x: x[4], cls._confmatrix))
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_CAPTIONS,
                                            captions)
        possiblevals = reduce( lambda a,b: a + '|' + b, \
                           map(lambda x: x[3], cls._confmatrix))
        tlvdata += coreapi.CoreConfTlv.pack(
            coreapi.CORE_TLV_CONF_POSSIBLE_VALUES, possiblevals)
        if cls._bitmap is not None:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_BITMAP,
                                                cls._bitmap)
        if cls._confgroups is not None:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_GROUPS,
                                                cls._confgroups)
        msg = coreapi.CoreConfMessage.pack(flags, tlvdata)
        return msg
 Convert this class to a Config API message. Some TLVs are defined
            by the class, but node number, conf type flags, and values must
            be passed in.
        
Convert this class to a Config API message. Some TLVs are defined
by the class, but node number, conf type flags, and values must
be passed in.
Convert this class to a Config API message . Some TLVs are defined by the class but node number conf type flags and values must be passed in .
def toconfmsg(cls, flags, nodenum, typeflags, values):
        keys = cls.getnames()
        keyvalues = map(lambda a,b: "%s=%s" % (a,b), keys, values)
        values_str = string.join(keyvalues, '|')
        tlvdata = ""
        if nodenum is not None:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_NODE,
                                                nodenum)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_OBJ,
                                            cls._name)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_TYPE,
                                            typeflags) 
        datatypes = tuple( map(lambda x: x[1], cls._confmatrix) )
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_DATA_TYPES,
                                            datatypes)
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_VALUES,
                                            values_str)
        captions = reduce( lambda a,b: a + '|' + b, \
                           map(lambda x: x[4], cls._confmatrix))
        tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_CAPTIONS,
                                            captions)
        possiblevals = reduce( lambda a,b: a + '|' + b, \
                           map(lambda x: x[3], cls._confmatrix))
        tlvdata += coreapi.CoreConfTlv.pack(
            coreapi.CORE_TLV_CONF_POSSIBLE_VALUES, possiblevals)
        if cls._bitmap is not None:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_BITMAP,
                                                cls._bitmap)
        if cls._confgroups is not None:
            tlvdata += coreapi.CoreConfTlv.pack(coreapi.CORE_TLV_CONF_GROUPS,
                                                cls._confgroups)
        msg = coreapi.CoreConfMessage.pack(flags, tlvdata)
        return msg
def toconfmsg ( cls , flags , nodenum , typeflags , values ) : keys = cls . getnames ( ) keyvalues = map ( lambda a , b : "%s=%s" % ( a , b ) , keys , values ) values_str = string . join ( keyvalues , '|' ) tlvdata = "" if nodenum is not None : tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_NODE , nodenum ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_OBJ , cls . _name ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_TYPE , typeflags ) datatypes = tuple ( map ( lambda x : x [ 1 ] , cls . _confmatrix ) ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_DATA_TYPES , datatypes ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_VALUES , values_str ) captions = reduce ( lambda a , b : a + '|' + b , map ( lambda x : x [ 4 ] , cls . _confmatrix ) ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_CAPTIONS , captions ) possiblevals = reduce ( lambda a , b : a + '|' + b , map ( lambda x : x [ 3 ] , cls . _confmatrix ) ) tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_POSSIBLE_VALUES , possiblevals ) if cls . _bitmap is not None : tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_BITMAP , cls . _bitmap ) if cls . _confgroups is not None : tlvdata += coreapi . CoreConfTlv . pack ( coreapi . CORE_TLV_CONF_GROUPS , cls . _confgroups ) msg = coreapi . CoreConfMessage . pack ( flags , tlvdata ) return msg
Convert this class to a Config API message.
Convert this class to a Config API message .
''' Convert this class to a Config API message. Some TLVs are defined
            by the class, but node number, conf type flags, and values must
            be passed in.
        '''
cls
flags
nodenum
typeflags
values