a guest Oct 3rd, 2017 414 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # This little script creates users in an airflow instance so it can be open to the public.
- # It gets the password in plain text so be careful where you run it.
- # You can properly invoke the script as follows:
- # ./add_user.py <username> <email@example.com> <secretpassword>
- import airflow, sys
- from airflow import models, settings
- from airflow.contrib.auth.backends.password_auth import PasswordUser
- user = PasswordUser(models.User())
- user.username = sys.argv
- user.email = sys.argv
- user.password = sys.argv
- session = settings.Session()
RAW Paste Data