File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2+ import os
23import sys
34
45import requests
56
67
7- def main (username , password ):
8+ def main ():
9+ admin_user = os .getenv ('ADMIN_USERNAME' , 'admin' )
10+ admin_pass = os .getenv ('ADMIN_PASSWORD' , 'admin' )
811 s = requests .Session ()
912 r = s .post (
1013 'http://localhost:8088/api/v1/security/login' ,
1114 json = {
12- 'username' : username ,
13- 'password' : password ,
15+ 'username' : admin_user ,
16+ 'password' : admin_pass ,
1417 'provider' : 'db' ,
1518 }
1619 )
@@ -75,9 +78,4 @@ def main(username, password):
7578 print (r .json ())
7679
7780if __name__ == '__main__' :
78- args = sys .argv
79- if len (args ) == 3 :
80- main (args [1 ], args [2 ])
81- else :
82- print ('usage: create-data-sources.py <username> <password>' )
83- sys .exit (2 )
81+ main ()
Original file line number Diff line number Diff line change @@ -15,4 +15,4 @@ superset fab create-admin \
1515 --email $EMAIL \
1616 --password $PASSWORD
1717superset init
18- ./create-data-sources.py $USERNAME $PASSWORD
18+ ./create-data-sources.py
You can’t perform that action at this time.
0 commit comments