Skip to content

Commit 76fc697

Browse files
authored
Merge branch 'master' into json-http
2 parents 14948a2 + c22840f commit 76fc697

File tree

24 files changed

+695
-54
lines changed

24 files changed

+695
-54
lines changed

appengine/flexible/analytics/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def track_event(category, action, label=None, value=0):
4242
}
4343

4444
response = requests.post(
45-
'http://www.google-analytics.com/collect', data=data)
45+
'https://www.google-analytics.com/collect', data=data)
4646

4747
# If the request fails, this will raise a RequestException. Depending
4848
# on your application's needs, this may be a non-error and can be caught

appengine/standard/analytics/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def track_event(category, action, label=None, value=0):
4545
}
4646

4747
response = requests.post(
48-
'http://www.google-analytics.com/collect', data=data)
48+
'https://www.google-analytics.com/collect', data=data)
4949

5050
# If the request fails, this will raise a RequestException. Depending
5151
# on your application's needs, this may be a non-error and can be caught

asset/cloud-client/quickstart_exportassets_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ def storage_client():
3333

3434
@pytest.fixture(scope='module')
3535
def asset_bucket(storage_client):
36-
storage_client.create_bucket(BUCKET)
36+
bucket = storage_client.create_bucket(BUCKET)
37+
38+
yield BUCKET
3739

3840
try:
39-
storage_client.delete_bucket(BUCKET)
41+
bucket.delete(force=True)
4042
except Exception as e:
4143
print('Failed to delete bucket{}'.format(BUCKET))
4244
raise e
4345

44-
yield BUCKET
45-
4646

4747
def test_export_assets(asset_bucket, capsys):
4848
dump_file_path = 'gs://{}/assets-dump.txt'.format(asset_bucket)

compute/metadata/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def wait_for_maintenance(callback):
5757
else:
5858
# Possible events:
5959
# MIGRATE_ON_HOST_MAINTENANCE: instance will be migrated
60-
# SHUTDOWN_ON_HOST_MAINTENANCE: instance will be shut down
60+
# TERMINATE_ON_HOST_MAINTENANCE: instance will be shut down
6161
maintenance_event = r.text
6262

6363
if maintenance_event != last_maintenance_event:

container_engine/django_tutorial/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ all: deploy
66
.PHONY: create-cluster
77
create-cluster:
88
gcloud container clusters create polls \
9-
--scope "https://www.googleapis.com/auth/userinfo.email","cloud-platform"
9+
--scopes "https://www.googleapis.com/auth/userinfo.email","cloud-platform"
1010

1111
.PHONY: create-bucket
1212
create-bucket:
1313
gsutil mb gs://$(GCLOUD_PROJECT)
14-
gsutil defacl set public-read gs://$(GCLOUD_PROJECT)
14+
gsutil defacl set public-read gs://$(GCLOUD_PROJECT)
1515

1616
.PHONY: build
1717
build:
1818
docker build -t gcr.io/$(GCLOUD_PROJECT)/polls .
1919

2020
.PHONY: push
2121
push: build
22-
gcloud docker push gcr.io/$(GCLOUD_PROJECT)/polls
22+
gcloud docker push -- gcr.io/$(GCLOUD_PROJECT)/polls
2323

2424
.PHONY: template
2525
template:
@@ -31,7 +31,7 @@ deploy: push template
3131

3232
.PHONY: update
3333
update:
34-
kubectl rolling-update polls --image=gcr.io/${GCLOUD_PROJECT}/polls
34+
kubectl patch deployment polls -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
3535

3636
.PHONY: delete
3737
delete:

container_engine/django_tutorial/polls.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
- containerPort: 8080
6262

6363
# [START proxy_container]
64-
- image: b.gcr.io/cloudsql-docker/gce-proxy:1.05
64+
- image: gcr.io/cloudsql-docker/gce-proxy:1.05
6565
name: cloudsql-proxy
6666
command: ["/cloud_sql_proxy", "--dir=/cloudsql",
6767
"-instances=<your-cloudsql-connection-string>=tcp:5432",

dataproc/submit_job_to_cluster.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ def get_pyspark_file(filename):
3434
return f, os.path.basename(filename)
3535

3636

37-
def get_region_from_zone(zone):
38-
try:
39-
region_as_list = zone.split('-')[:-1]
40-
return '-'.join(region_as_list)
41-
except (AttributeError, IndexError, ValueError):
42-
raise ValueError('Invalid zone provided, please check your input.')
43-
44-
4537
def upload_pyspark_file(project_id, bucket_name, filename, file):
4638
"""Uploads the PySpark file in this directory to the configured
4739
input bucket."""
@@ -199,7 +191,7 @@ def get_client():
199191
def main(project_id, zone, cluster_name, bucket_name,
200192
pyspark_file=None, create_new_cluster=True):
201193
dataproc = get_client()
202-
region = get_region_from_zone(zone)
194+
region = 'global'
203195
try:
204196
if pyspark_file:
205197
spark_file, spark_filename = get_pyspark_file(pyspark_file)

endpoints/bookstore-grpc/jwt_token_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def generate_jwt(service_account_file, issuer, audiences):
4848
# swagger spec. It can be any string.
4949
'iss': issuer,
5050
# sub and email are mapped to the user id and email respectively.
51-
'sub': '12345678',
51+
'sub': issuer,
5252
'email': 'user@example.com'
5353
}
5454

endpoints/kubernetes/grpc-bookstore.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
spec:
4545
containers:
4646
- name: esp
47-
image: gcr.io/endpoints-release/endpoints-runtime:1
47+
image: gcr.io/endpoints-release/endpoints-runtime:1.16.0
4848
args: [
4949
"--http2_port=9000",
5050
"--service=SERVICE_NAME",

error_reporting/api/report_exception.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515

1616
# [START error_reporting]
17+
# [START error_reporting_quickstart]
18+
# [START error_reporting_setup_python]
1719
def simulate_error():
1820
from google.cloud import error_reporting
1921

@@ -23,15 +25,19 @@ def simulate_error():
2325
raise NameError
2426
except Exception:
2527
client.report_exception()
28+
# [END error_reporting_setup_python]
29+
# [END error_reporting_quickstart]
2630
# [END error_reporting]
2731

2832

2933
# [START error_reporting_manual]
34+
# [START error_reporting_setup_python_manual]
3035
def report_manual_error():
3136
from google.cloud import error_reporting
3237

3338
client = error_reporting.Client()
3439
client.report("An error has occurred.")
40+
# [START error_reporting_setup_python_manual]
3541
# [END error_reporting_manual]
3642

3743

0 commit comments

Comments
 (0)