Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
arbrown committed May 23, 2022
1 parent d15abab commit 81a80c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions google/cloud/logging_v2/_instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def add_instrumentation(entries, **kw):
is_written = False
for entry in entries:
if (
is_written == False
is_written is False
and hasattr(entry, "payload")
and entry.payload is dict
and entry.payload.has_key(_DIAGNOSTIC_INFO_KEY)
and entry.payload[_DIAGNOSTIC_INFO_KEY].has_key(_INSTRUMENTATION_SOURCE_KEY)
and _DIAGNOSTIC_INFO_KEY in entry.payload
and _INSTRUMENTATION_SOURCE_KEY in entry.payload[_DIAGNOSTIC_INFO_KEY]
):
current_info = entry.payload[_DIAGNOSTIC_INFO_KEY][
_INSTRUMENTATION_SOURCE_KEY
Expand Down Expand Up @@ -131,8 +131,8 @@ def _get_instrumentation_source(name=None, version=None):
Returns:
obj: JSON object with library information
"""
name = name if name != None else _PYTHON_LIBRARY_NAME
version = version if version != None else _LIBRARY_VERSION
name = name if name is not None else _PYTHON_LIBRARY_NAME
version = version if version is not None else _LIBRARY_VERSION
return {
"name": truncate_string(name, _MAX_NAME_LENGTH),
"version": truncate_string(version, _MAX_VERSION_LENGTH),
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/logging_v2/handlers/structured_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def format(self, record):
return gcp_payload

def emit(self, record):
if google.cloud.logging_v2.instrumentation_emitted == False:
if google.cloud.logging_v2.instrumentation_emitted is False:
self.emit_instrumentation_info()
super().emit(record)

Expand Down

0 comments on commit 81a80c8

Please sign in to comment.