Skip to content

Commit

Permalink
Update synlogin
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjtaylor committed Dec 14, 2023
1 parent 3644360 commit 82e1835
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from synapseclient import EntityViewSchema, EntityViewType, Synapse

import sys
import os

fileview = sys.argv[1]
webhook_url = sys.argv[2]
Expand All @@ -19,17 +20,12 @@ def synapse_login(synapse_config=synapseclient.client.CONFIG_FILE):
Synapse connection
"""
try:
syn = synapseclient.Synapse(skip_checks=True, configPath=synapse_config)
syn = synapseclient.Synapse(skip_checks=True)
if os.getenv("SCHEDULED_JOB_SECRETS") is not None:
secrets = json.loads(os.getenv("SCHEDULED_JOB_SECRETS"))
syn.login(silent=True, authToken=secrets["SYNAPSE_AUTH_TOKEN"])
else:
syn.login(silent=True)
except (SynapseNoCredentialsError, SynapseAuthenticationError):
raise ValueError(
"Login error: please make sure you have correctly "
"configured your client."
)
return syn


Expand Down

0 comments on commit 82e1835

Please sign in to comment.