def get_google_cloud_credentials(module, scopes=[]):
 creds = _get_gcp_credentials(module, require_valid_json=True, check_libcloud=False)
 try:
  credentials = ServiceAccountCredentials.from_json_keyfile_name(creds['credentials_file'], scopes=scopes)
  return (credentials, creds)
 except Exception as e:
  module.fail_json(msg=unexpected_error_msg(e), changed=False)
  return (None, None)

def get_google_cloud_credentials ( module , scopes = [ ] ) : creds = _get_gcp_credentials ( module , require_valid_json = True , check_libcloud = False ) try : credentials = ServiceAccountCredentials . from_json_keyfile_name ( creds [ 'credentials_file' ] , scopes = scopes ) return ( credentials , creds ) except Exception as e : module . fail_json ( msg = unexpected_error_msg ( e ) , changed = False ) return ( None , None )
get credentials object for use with google cloud client .