def setup_tokens(token, username, user):
    'Create a token file for kubernetes authentication.'
    root_cdk = '/root/cdk'
    if (not os.path.isdir(root_cdk)):
        os.makedirs(root_cdk)
    known_tokens = os.path.join(root_cdk, 'known_tokens.csv')
    if (not token):
        token = token_generator()
    with open(known_tokens, 'a') as stream:
        stream.write('{0},{1},{2}\n'.format(token, username, user))
Create a token file for kubernetes authentication.
def setup_tokens(token, username, user):
    
    root_cdk = '/root/cdk'
    if (not os.path.isdir(root_cdk)):
        os.makedirs(root_cdk)
    known_tokens = os.path.join(root_cdk, 'known_tokens.csv')
    if (not token):
        token = token_generator()
    with open(known_tokens, 'a') as stream:
        stream.write('{0},{1},{2}\n'.format(token, username, user))