def show_profiles(name, server, org_vm):
    """
    Create a table of info about the profiles based on getting the
    references, etc. both in the dependent and antecedent direction.

    The resulting table is printed.
    """
    rows = []
    for profile_inst in server.profiles:
        pn = profile_name(org_vm, profile_inst)
        deps = get_associated_profile_names(
            profile_inst.path, "dependent", org_vm, server,
            include_classnames=False)
        dep_refs = get_references(profile_inst.path, "antecedent", pn, server)
        ants = get_associated_profile_names(
            profile_inst.path, "antecedent", org_vm, server,
            include_classnames=False)
        ant_refs = get_references(profile_inst.path, "dependent",
                                  profile_name, server)

        # get unique class names
        dep_ref_clns = set([ref.classname for ref in dep_refs])
        ant_ref_clns = set([ref.classname for ref in ant_refs])
        row = (pn,
               fold_list(deps),
               fold_list(list(dep_ref_clns)),
               fold_list(ants),
               fold_list(list(ant_ref_clns)))
        rows.append(row)

        # append this server to the  dict of servers for this profile
        SERVERS_FOR_PROFILE[profile_name].append(name)

    title = '%s: Advertised profiles showing Profiles associations' \
        'Dependencies are Associators, AssocClass=CIM_ReferencedProfile' \
        'This table shows the results for ' % name
    headers = ['Profile',
               'Assoc CIMReferencedProfile\nResultRole\nDependent',
               'Ref classes References\nRole=Dependent',
               'Assoc CIMReferencedProfile\nResultRole\nAntecedent',
               'Ref classesReferences\nRole=Dependent']
    print_table(title, headers, rows, sort_columns=[1, 0])
def show_profiles ( name , server , org_vm ) : rows = [ ] for profile_inst in server . profiles : pn = profile_name ( org_vm , profile_inst ) deps = get_associated_profile_names ( profile_inst . path , "dependent" , org_vm , server , include_classnames = False ) dep_refs = get_references ( profile_inst . path , "antecedent" , pn , server ) ants = get_associated_profile_names ( profile_inst . path , "antecedent" , org_vm , server , include_classnames = False ) ant_refs = get_references ( profile_inst . path , "dependent" , profile_name , server ) dep_ref_clns = set ( [ ref . classname for ref in dep_refs ] ) ant_ref_clns = set ( [ ref . classname for ref in ant_refs ] ) row = ( pn , fold_list ( deps ) , fold_list ( list ( dep_ref_clns ) ) , fold_list ( ants ) , fold_list ( list ( ant_ref_clns ) ) ) rows . append ( row ) SERVERS_FOR_PROFILE [ profile_name ] . append ( name ) title = '%s: Advertised profiles showing Profiles associations' 'Dependencies are Associators, AssocClass=CIM_ReferencedProfile' 'This table shows the results for ' % name headers = [ 'Profile' , 'Assoc CIMReferencedProfile\nResultRole\nDependent' , 'Ref classes References\nRole=Dependent' , 'Assoc CIMReferencedProfile\nResultRole\nAntecedent' , 'Ref classesReferences\nRole=Dependent' ] print_table ( title , headers , rows , sort_columns = [ 1 , 0 ] )
Create a table of info about the profiles based on getting the
    references, etc. both in the dependent and antecedent direction.

    The resulting table is printed.