Cleanup setting discoveryServiceUrl (#877)

This commit is contained in:
Ross Scroggs
2019-04-08 16:15:43 -07:00
committed by Jay Lee
parent 05cbe1c6f3
commit 01d50adce7

View File

@ -7218,9 +7218,9 @@ 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,
discoveryServiceUrl=googleapiclient.discovery.V2_DISCOVERY_URI),
http) http)
def getGAMProjectAPIs(): def getGAMProjectAPIs():
@ -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