Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c5a1160

Browse filesBrowse files
BrandonYJon Wayne Parrott
authored andcommitted
Handle case where attribute not set (GoogleCloudPlatform#1143)
1 parent 954b6fb commit c5a1160
Copy full SHA for c5a1160

File tree

Expand file treeCollapse file tree

1 file changed

+5
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-6
lines changed

‎storage/cloud-client/notification_polling.py

Copy file name to clipboardExpand all lines: storage/cloud-client/notification_polling.py
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ def summarize(message):
6464
bucket_id = attributes['bucketId']
6565
object_id = attributes['objectId']
6666
generation = attributes['objectGeneration']
67-
overwrote_generation = attributes['overwroteGeneration']
68-
overwritten_by_generation = attributes['overwrittenByGeneration']
6967
description = (
7068
'\tEvent type: {event_type}\n'
7169
'\tBucket ID: {bucket_id}\n'
@@ -76,11 +74,12 @@ def summarize(message):
7674
object_id=object_id,
7775
generation=generation)
7876

79-
if overwrote_generation:
80-
description += '\tOverwrote generation: %s\n' % overwrote_generation
81-
if overwritten_by_generation:
77+
if 'overwroteGeneration' in attributes:
78+
description += '\tOverwrote generation: %s\n' % (
79+
attributes['overwroteGeneration'])
80+
if 'overwrittenByGeneration' in attributes:
8281
description += '\tOverwritten by generation: %s\n' % (
83-
overwritten_by_generation)
82+
attributes['ovewrittenByGeneration'])
8483

8584
payload_format = attributes['payloadFormat']
8685
if payload_format == 'JSON_API_V1':

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.