From d75a5e78a514d977ce5817364f3a7eed74351697 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Mon, 7 Nov 2016 07:21:55 -0800 Subject: [PATCH] Have doCreateProject find proper JSON files (#318) As in https://github.com/jay0lee/GAM/pull/313, factor in the user's environment variables. On a new installation, the files will be in GAM Path, but on an existing installation the environment variables may have them located somewhere else. --- src/gam.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gam.py b/src/gam.py index 80fbefa3..6a031741 100755 --- a/src/gam.py +++ b/src/gam.py @@ -6920,7 +6920,7 @@ and accept the Terms of Service (ToS). As soon as you've accepted the ToS popup, body = {u'privateKeyType': u'TYPE_GOOGLE_CREDENTIALS_FILE', u'keyAlgorithm': u'KEY_ALG_RSA_4096'} key = callGAPI(iam.projects().serviceAccounts().keys(), u'create', name=service_account[u'name'], body=body) oauth2service_data = base64.b64decode(key[u'privateKeyData']) - service_account_file = os.path.join(GM_Globals[GM_GAM_PATH], FN_OAUTH2SERVICE_JSON) + service_account_file = GC_Values[GC_OAUTH2SERVICE_JSON] if os.path.isfile(service_account_file): service_account_file = u'%s-%s' % (service_account_file, project_id) writeFile(service_account_file, oauth2service_data, continueOnError=False) @@ -6953,7 +6953,7 @@ and accept the Terms of Service (ToS). As soon as you've accepted the ToS popup, "token_uri": "https://accounts.google.com/o/oauth2/token" } }''' % (client_id, client_secret, project_id) - client_secrets_file = os.path.join(GM_Globals[GM_GAM_PATH], FN_CLIENT_SECRETS_JSON) + client_secrets_file = GC_Values[GC_CLIENT_SECRETS_JSON] if os.path.isfile(client_secrets_file): client_secrets_file = u'%s-%s' % (client_secrets_file, project_id) writeFile(client_secrets_file, cs_data, continueOnError=False)