File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 11from functools import lru_cache
2- try :
3- from configparser import SafeConfigParser
4- except ImportError :
5- from ConfigParser import SafeConfigParser
2+ from configparser import SafeConfigParser
63from getpass import getpass
74from simplecrypt import decrypt
85from io import StringIO
96from pkg_resources import resource_stream
107from sqlalchemy import create_engine
118import socket
9+ import os
1210
1311
1412__all__ = ['get_credentials' , 'create_factdb_engine' ]
@@ -37,9 +35,12 @@ def get_credentials():
3735
3836 use get_credentials().get(group, element) to retrieve elements
3937 '''
38+ if 'FACT_PASSWORD' in os .environ :
39+ passwd = os .environ ['FACT_PASSWORD' ]
40+ else :
41+ passwd = getpass ('Please enter the current, universal FACT password: ' )
42+
4043 with resource_stream ('fact' , 'credentials/credentials.encrypted' ) as f :
41- print ('Please enter the current, universal FACT password' )
42- passwd = getpass ()
4344 decrypted = decrypt (passwd , f .read ()).decode ('utf-8' )
4445
4546 config = SafeConfigParser ()
You can’t perform that action at this time.
0 commit comments