(profile_oid_collection, oid_node)
Updates a collection of profile nodes, indexed by oid, adding a scalar node
Updates a collection of profile nodes, indexed by oid, adding a scalar node
Updates a collection of profile nodes indexed by oid adding a scalar node
def _add_profile_scalar_node(profile_oid_collection, oid_node):
    """
    Updates a collection of profile nodes, indexed by oid, adding a scalar node
    """
    if oid_node.node_type != 'scalar':
        raise ValueError('Must be a scalar node')
    name = oid_node.name
    mib = oid_node.mib
    oid = oid_node.oid

    profile_node = {'MIB': mib}
    if not oid.endswith('.0'):
        oid = oid + '.0'
    symbol = {'name': name, 'OID': oid}
    if oid_node.description is not None:
        symbol['description'] = oid_node.description
    profile_node['symbol'] = symbol
    profile_oid_collection[oid] = profile_node
def _add_profile_scalar_node ( profile_oid_collection , oid_node ) : if oid_node . node_type != 'scalar' : raise ValueError ( 'Must be a scalar node' ) name = oid_node . name mib = oid_node . mib oid = oid_node . oid profile_node = { 'MIB' : mib } if not oid . endswith ( '.0' ) : oid = oid + '.0' symbol = { 'name' : name , 'OID' : oid } if oid_node . description is not None : symbol [ 'description' ] = oid_node . description profile_node [ 'symbol' ] = symbol profile_oid_collection [ oid ] = profile_node