Skip to content

Commit 8bd413c

Browse files
committed
updating pelican export job to use environment variables as a backup if credential files are missing.
1 parent 5bf2c87 commit 8bd413c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

job_export.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@
5050
filters = json.dumps({"filter": input_data.get("filter", {})})
5151
case_ids = gql.execute(filters=filters)
5252

53-
if os.path.exists("/peregrine-creds.json")
53+
if os.path.exists("/peregrine-creds.json"):
5454
try:
5555
with open("/peregrine-creds.json") as pelican_creds_file:
5656
peregrine_creds = json.load(pelican_creds_file)
5757
except json.JSONDecodeError as e:
5858
print(f"Failed to load credentials file: {e}")
5959
peregrine_creds = {}
6060
else:
61-
print(f"Credentials file not found: {e}")
61+
print(f"Credentials file not found. Using environment variables.")
62+
peregrine_creds = {}
6263

6364
# Set variables, prioritizing environment variables
6465
DB_HOST = os.getenv("DB_HOST", peregrine_creds.get("db_host"))

0 commit comments

Comments
 (0)