def get_csv_password(csv_fname, user):
    'Get the password for the given user within the csv file provided.'
    root_cdk = '/root/cdk'
    tokens_fname = (Path(root_cdk) / csv_fname)
    if (not tokens_fname.is_file()):
        return None
    with tokens_fname.open('r') as stream:
        for line in stream:
            record = line.split(',')
            try:
                if (record[1] == user):
                    return record[0]
            except IndexError:
                continue
    return None
Get the password for the given user within the csv file provided.
def get_csv_password(csv_fname, user):
    
    root_cdk = '/root/cdk'
    tokens_fname = (Path(root_cdk) / csv_fname)
    if (not tokens_fname.is_file()):
        return None
    with tokens_fname.open('r') as stream:
        for line in stream:
            record = line.split(',')
            try:
                if (record[1] == user):
                    return record[0]
            except IndexError:
                continue
    return None