Last active
July 26, 2016 06:20
-
-
Save tmkasun/ed50c63820be83d6bcf168e28ed91d3d to your computer and use it in GitHub Desktop.
Sample user creation tool for WSO2 ES bulk user uploading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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