Skip to content

Instantly share code, notes, and snippets.

@tmkasun
Last active July 26, 2016 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmkasun/ed50c63820be83d6bcf168e28ed91d3d to your computer and use it in GitHub Desktop.
Save tmkasun/ed50c63820be83d6bcf168e28ed91d3d to your computer and use it in GitHub Desktop.
Sample user creation tool for WSO2 ES bulk user uploading
HEADER_STRING = "Username,Password,Claims,"
data_line = "{0},{0},http://{1}//claims/emailaddress={0}@{1},{2}\n"
file_string = HEADER_STRING + "\n"
domain = "knnect.com"
role = "http://wso2.org/claims/role=admin"
name_template = "user{}"
users_count = 51
with open(r'usernames.csv','w') as sample_file:
for index in range(1, users_count):
current_name = name_template.format(index)
file_string += data_line.format(current_name, domain, role)
sample_file.write(file_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment