Commit 5bf2c87 1 parent 337d18a commit 5bf2c87 Copy full SHA for 5bf2c87
File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 50
50
filters = json .dumps ({"filter" : input_data .get ("filter" , {})})
51
51
case_ids = gql .execute (filters = filters )
52
52
53
- try :
54
- with open ("/peregrine-creds.json" ) as pelican_creds_file :
55
- peregrine_creds = json .load (pelican_creds_file )
56
- except (FileNotFoundError , json .JSONDecodeError ) as e :
57
- print (f"Failed to load credentials file: { e } " )
58
- peregrine_creds = {}
53
+ if os .path .exists ("/peregrine-creds.json" )
54
+ try :
55
+ with open ("/peregrine-creds.json" ) as pelican_creds_file :
56
+ peregrine_creds = json .load (pelican_creds_file )
57
+ except json .JSONDecodeError as e :
58
+ print (f"Failed to load credentials file: { e } " )
59
+ peregrine_creds = {}
60
+ else :
61
+ print (f"Credentials file not found: { e } " )
59
62
60
63
# Set variables, prioritizing environment variables
61
64
DB_HOST = os .getenv ("DB_HOST" , peregrine_creds .get ("db_host" ))
You can’t perform that action at this time.
0 commit comments