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

    mib = oid_node.mib
    name = oid_node.name
    oid = oid_node.oid

    profile_node = {'MIB': mib}
    table = {'name': name, 'OID': oid}
    if oid_node.description is not None:
        table['description'] = oid_node.description
    symbols = []
    metric_tags = []
    # find symbols for this table, they might be already added
    if oid in profile_oid_collection:
        symbols = profile_oid_collection[oid]['symbols']
        metric_tags = profile_oid_collection[oid]['metric_tags']

    profile_node['table'] = table
    profile_node['symbols'] = symbols
    profile_node['metric_tags'] = metric_tags
    profile_oid_collection[oid] = profile_node
def _add_profile_table_node ( profile_oid_collection , oid_node ) : if oid_node . node_type != 'table' : raise ValueError ( 'Must be a table node' ) mib = oid_node . mib name = oid_node . name oid = oid_node . oid profile_node = { 'MIB' : mib } table = { 'name' : name , 'OID' : oid } if oid_node . description is not None : table [ 'description' ] = oid_node . description symbols = [ ] metric_tags = [ ] # find symbols for this table, they might be already added if oid in profile_oid_collection : symbols = profile_oid_collection [ oid ] [ 'symbols' ] metric_tags = profile_oid_collection [ oid ] [ 'metric_tags' ] profile_node [ 'table' ] = table profile_node [ 'symbols' ] = symbols profile_node [ 'metric_tags' ] = metric_tags profile_oid_collection [ oid ] = profile_node