Пример #1
0
def get(data):
    static_category = ParameterCategory("edgusers_static", data)
    edgusers = "152:${EDG_USER}:152,151:${EDG_GROUP},${INFOSYS_GROUP}:EDG user:${EDG_HOME_DIR}\n" \
               "153:${EDGINFO_USER}:153,151:${EDGINFO_USER},${INFOSYS_GROUP}:EDG info user:${EDGINFO_HOME_DIR}\n" \
               "155:${GLITE_USER}:155:${GLITE_GROUP}:gLite user:${GLITE_HOME_DIR} \n" \
               "154:${BDII_USER}:158:${BDII_GROUP}:BDII user:${BDII_HOME_DIR}"
    static_category.add(edgusers)
    return [static_category]
Пример #2
0
def get(data):
    advanced_category = ParameterCategory("wn_list_advanced", data)
    dns_info = data['dns']
    hostnames = []
    for dns in dns_info:
        if dns['type'] == 'worker_node':
            hostnames.append(dns['container_fqdn'])
            advanced_category.add(dns['container_fqdn'] + "\n")
    return [advanced_category]
def get(data, id):
    advanced_category = ParameterCategory("users_advanced", data)
    component_section = get_component_section(data, id)
    voms_config = get_voms_config(data, component_section)
    unique_pool_accounts = []
    for config in voms_config:
        if 'comment' in config:
            flag = config['comment']
        else:
            flag = ''
        for pool_account in config['pool_accounts']:
            unique = True
            for existing_pool_account in unique_pool_accounts:
                if existing_pool_account['pool_account']['initial_uid'] == pool_account['initial_uid']:
                    unique = False
                    break
            if unique:
                unique_pool_accounts.append({
                    'vo': config['vo'],
                    'pool_account': pool_account,
                    'flag': flag
                })

    for pool_account_info in unique_pool_accounts:
        pool_account = pool_account_info['pool_account']
        base_name = pool_account['base_name']
        initial_uid = pool_account['initial_uid']
        users_num = pool_account['users_num']

        primary_group = pool_account['primary_group']
        gid1 = primary_group['gid']
        primary_group_name = primary_group['name']

        vo = pool_account_info['vo']['name']
        flag = pool_account_info['flag']
        for user_num in list(range(0, users_num)):
            uid = initial_uid + user_num
            login_name = base_name + str(user_num + 1).zfill(3)
            user_entry = "{uid}:{login_name}:{gid1}".format(uid = uid, login_name = login_name, gid1 = gid1)
            if "secondary_groups" in pool_account and len(pool_account['secondary_groups']) >0:

                for secondary_group in pool_account['secondary_groups']:
                    user_entry += ",{gid}".format(gid = secondary_group['gid'])
                user_entry += ":{primary_group_name}".format(primary_group_name =primary_group_name)
                for secondary_group in pool_account['secondary_groups']:
                    user_entry += ",{group_name}".format(group_name=secondary_group['name'])
                user_entry += ":"
                user_entry += "{vo}:{flag}:".format(vo =vo, flag = flag)
            else:
                user_entry = "{uid}:{login_name}:{gid1}:{GROUP1}:{vo}:{flag}:".format(uid=uid, login_name=login_name, gid1=gid1, GROUP1 = primary_group_name, vo = vo, flag = flag)

            advanced_category.add(user_entry + "\n")

    return [advanced_category]
def get(data, id):
    advanced_category = ParameterCategory("users_advanced", data)
    component_section = get_component_section(data, id)
    voms_config = get_voms_config(data, component_section)
    for config in voms_config:
        voms_fqan = config['voms_fqan']
        flag = config['comment'] if 'comment' in config else ''
        groups_string = "\"{voms_fqan}\":::{flag}:".format(voms_fqan=voms_fqan,
                                                           flag=flag)
        advanced_category.add(groups_string + "\n")
    return [advanced_category]
Пример #5
0
def get(data, id):
    advanced_category = ParameterCategory("hosts_advanced", data)
    dns = None
    for dns_info in data['dns']:
        if dns_info['execution_id'] == int(id):
            dns = dns_info
            break
    if dns is None:
        raise Exception(
            "Cannot find dns info for current lightweight component in augmented site level config file"
        )

    advanced_category.add("{host_ip} {host_fqdn} {hostname}".format(
        host_ip=dns['host_ip'],
        host_fqdn=dns['host_fqdn'],
        hostname=dns['host_fqdn'].split('.')[0]))
    return [advanced_category]
Пример #6
0
def get(data):
    static_category = ParameterCategory("edgusers_static", data)
    edgusers = "155:${GLITE_USER}:155:${GLITE_GROUP}:gLite user:${GLITE_HOME_DIR} \n" \
               "154:${BDII_USER}:158:${BDII_GROUP}:BDII user:${BDII_HOME_DIR}"
    static_category.add(edgusers)
    return [static_category]