Diederik has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/60930


Change subject: Added simple script to create admin account through CLI
......................................................................

Added simple script to create admin account through CLI

Change-Id: I1252dd377132ea3b53962775f1ee0aee113d4ce6
---
A create_account.py
1 file changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/E3Analysis 
refs/changes/30/60930/1

diff --git a/create_account.py b/create_account.py
new file mode 100644
index 0000000..c177c98
--- /dev/null
+++ b/create_account.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# coding=utf-8
+
+#Create default admin account
+#For puppet from drdee
+
+import argparse
+from user_metrics.api.session import APIUser
+
+def create_user(username, password):
+       u = APIUser(username)
+       u.set_password(password)
+       u.register_user()
+
+
+if __name__ == '__main__':
+       parser = argparse.ArgumentParser()
+       parser.add_argument('-u', '--username', action='store', 
dest='username', required=True, default='admin', help='give username for 
usermetrics api')
+       parser.add_argument('-p', '--password', action='store', 
dest='password', required=True, default='vagrant', help='give password for 
user')
+       args = parser.parse_args()
+
+       create_user(args.username, args.password)

-- 
To view, visit https://gerrit.wikimedia.org/r/60930
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1252dd377132ea3b53962775f1ee0aee113d4ce6
Gerrit-PatchSet: 1
Gerrit-Project: analytics/E3Analysis
Gerrit-Branch: master
Gerrit-Owner: Diederik <dvanli...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to