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 1
1
from functools import lru_cache
2
- try :
3
- from configparser import SafeConfigParser
4
- except ImportError :
5
- from ConfigParser import SafeConfigParser
2
+ from configparser import SafeConfigParser
6
3
from getpass import getpass
7
4
from simplecrypt import decrypt
8
5
from io import StringIO
9
6
from pkg_resources import resource_stream
10
7
from sqlalchemy import create_engine
11
8
import socket
9
+ import os
12
10
13
11
14
12
__all__ = ['get_credentials' , 'create_factdb_engine' ]
@@ -37,9 +35,12 @@ def get_credentials():
37
35
38
36
use get_credentials().get(group, element) to retrieve elements
39
37
'''
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
+
40
43
with resource_stream ('fact' , 'credentials/credentials.encrypted' ) as f :
41
- print ('Please enter the current, universal FACT password' )
42
- passwd = getpass ()
43
44
decrypted = decrypt (passwd , f .read ()).decode ('utf-8' )
44
45
45
46
config = SafeConfigParser ()
You can’t perform that action at this time.
0 commit comments