Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Remove usage of GoogleCredentials [(#810)](GoogleCloudPlatform/python…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Wayne Parrott authored Feb 17, 2017
1 parent 514cafd commit f3dc0f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions samples/snippets/create_cluster_and_submit_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
import argparse
import os

from apiclient import discovery
from google.cloud import storage
from oauth2client.client import GoogleCredentials
import googleapiclient.discovery

# Currently only the "global" region is supported
REGION = 'global'
Expand Down Expand Up @@ -177,8 +176,7 @@ def wait_for_job(dataproc, project, job_id):
def get_client():
"""Builds an http client authenticated with the service account
credentials."""
credentials = GoogleCredentials.get_application_default()
dataproc = discovery.build('dataproc', 'v1', credentials=credentials)
dataproc = googleapiclient.discovery.build('dataproc', 'v1')
return dataproc
# [END get_client]

Expand Down
9 changes: 3 additions & 6 deletions samples/snippets/list_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

import argparse

from apiclient import discovery
from oauth2client.client import GoogleCredentials
import googleapiclient.discovery

# Currently only the "global" region is supported
REGION = 'global'
Expand All @@ -34,10 +33,8 @@ def list_clusters(dataproc, project):

# [START get_client]
def get_client():
"""Builds an http client authenticated with the service account
credentials."""
credentials = GoogleCredentials.get_application_default()
dataproc = discovery.build('dataproc', 'v1', credentials=credentials)
"""Builds a client to the dataproc API."""
dataproc = googleapiclient.discovery.build('dataproc', 'v1')
return dataproc
# [END get_client]

Expand Down

0 comments on commit f3dc0f3

Please sign in to comment.