mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Merge pull request #3008 from quadproduction/site-sync-gdrive-credential-path-resolve-env
Resolve environment variable in google drive credential path
This commit is contained in:
commit
cdbcfadae2
1 changed files with 17 additions and 2 deletions
|
|
@ -73,8 +73,23 @@ class GDriveHandler(AbstractProvider):
|
|||
format(site_name))
|
||||
return
|
||||
|
||||
cred_path = self.presets.get("credentials_url", {}).\
|
||||
get(platform.system().lower()) or ''
|
||||
current_platform = platform.system().lower()
|
||||
cred_path = self.presets.get("credentials_url", {}). \
|
||||
get(current_platform) or ''
|
||||
|
||||
if not cred_path:
|
||||
msg = "Sync Server: Please, fill the credentials for gdrive "\
|
||||
"provider for platform '{}' !".format(current_platform)
|
||||
log.info(msg)
|
||||
return
|
||||
|
||||
try:
|
||||
cred_path = cred_path.format(**os.environ)
|
||||
except KeyError as e:
|
||||
log.info("Sync Server: The key(s) {} does not exist in the "
|
||||
"environment variables".format(" ".join(e.args)))
|
||||
return
|
||||
|
||||
if not os.path.exists(cred_path):
|
||||
msg = "Sync Server: No credentials for gdrive provider " + \
|
||||
"for '{}' on path '{}'!".format(site_name, cred_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue