mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-10 14:43:34 +00:00
Cleanup setting discoveryServiceUrl (#877)
This commit is contained in:
15
src/gam.py
15
src/gam.py
@ -7218,10 +7218,10 @@ def getCRMService(login_hint):
|
|||||||
noPythonSSLExit()
|
noPythonSSLExit()
|
||||||
credentials.user_agent = GAM_INFO
|
credentials.user_agent = GAM_INFO
|
||||||
http = credentials.authorize(httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL], cache=None))
|
http = credentials.authorize(httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL], cache=None))
|
||||||
discoveryServiceUrl = googleapiclient.discovery.V2_DISCOVERY_URI
|
|
||||||
return (googleapiclient.discovery.build(u'cloudresourcemanager', u'v1',
|
return (googleapiclient.discovery.build(u'cloudresourcemanager', u'v1',
|
||||||
http=http, cache_discovery=False, discoveryServiceUrl=discoveryServiceUrl),
|
http=http, cache_discovery=False,
|
||||||
http)
|
discoveryServiceUrl=googleapiclient.discovery.V2_DISCOVERY_URI),
|
||||||
|
http)
|
||||||
|
|
||||||
def getGAMProjectAPIs():
|
def getGAMProjectAPIs():
|
||||||
httpObj = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL])
|
httpObj = httplib2.Http(disable_ssl_certificate_validation=GC_Values[GC_NO_VERIFY_SSL])
|
||||||
@ -7231,10 +7231,9 @@ def getGAMProjectAPIs():
|
|||||||
def enableGAMProjectAPIs(GAMProjectAPIs, httpObj, projectId, checkEnabled, i=0, count=0):
|
def enableGAMProjectAPIs(GAMProjectAPIs, httpObj, projectId, checkEnabled, i=0, count=0):
|
||||||
apis = GAMProjectAPIs[:]
|
apis = GAMProjectAPIs[:]
|
||||||
project_name = u'project:{0}'.format(projectId)
|
project_name = u'project:{0}'.format(projectId)
|
||||||
discoveryServiceUrl = googleapiclient.discovery.V2_DISCOVERY_URI
|
|
||||||
serveman = googleapiclient.discovery.build(u'servicemanagement', u'v1',
|
serveman = googleapiclient.discovery.build(u'servicemanagement', u'v1',
|
||||||
http=httpObj, cache_discovery=False,
|
http=httpObj, cache_discovery=False,
|
||||||
discoveryServiceUrl=discoveryServiceUrl)
|
discoveryServiceUrl=googleapiclient.discovery.V2_DISCOVERY_URI)
|
||||||
status = True
|
status = True
|
||||||
if checkEnabled:
|
if checkEnabled:
|
||||||
try:
|
try:
|
||||||
@ -7309,7 +7308,9 @@ def _createClientSecretsOauth2service(httpObj, projectId):
|
|||||||
|
|
||||||
simplehttp, GAMProjectAPIs = getGAMProjectAPIs()
|
simplehttp, GAMProjectAPIs = getGAMProjectAPIs()
|
||||||
enableGAMProjectAPIs(GAMProjectAPIs, httpObj, projectId, False)
|
enableGAMProjectAPIs(GAMProjectAPIs, httpObj, projectId, False)
|
||||||
iam = googleapiclient.discovery.build(u'iam', u'v1', http=httpObj, cache_discovery=False)
|
iam = googleapiclient.discovery.build(u'iam', u'v1',
|
||||||
|
http=httpObj, cache_discovery=False,
|
||||||
|
discoveryServiceUrl=googleapiclient.discovery.V2_DISCOVERY_URI)
|
||||||
sa_list = callGAPI(iam.projects().serviceAccounts(), u'list',
|
sa_list = callGAPI(iam.projects().serviceAccounts(), u'list',
|
||||||
name=u'projects/%s' % projectId)
|
name=u'projects/%s' % projectId)
|
||||||
service_account = None
|
service_account = None
|
||||||
|
Reference in New Issue
Block a user