Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
format task_utilities file
Browse files Browse the repository at this point in the history
  • Loading branch information
omrozowicz-splunk committed Aug 9, 2021
1 parent 7d22b3f commit 883b5a4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions splunk_connect_for_snmp_poller/manager/task_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ def snmp_get_handler(
*var_binds,
)
)
if not _any_failure_happened(errorIndication, errorStatus, errorIndex, varBinds):
if not _any_failure_happened(
errorIndication, errorStatus, errorIndex, varBinds
):
for varbind in varBinds:
result, is_metric = get_translated_string(mib_server_url, [varbind])
post_data_to_splunk_hec(
Expand All @@ -223,7 +225,9 @@ def snmp_get_handler(
)


def _any_failure_happened(errorIndication, errorStatus: int, errorIndex: int, varBinds: list) -> bool:
def _any_failure_happened(
errorIndication, errorStatus: int, errorIndex: int, varBinds: list
) -> bool:
"""
This function checks if any failure happened during GET or BULK operation.
@param errorIndication:
Expand Down Expand Up @@ -273,7 +277,9 @@ def snmp_bulk_handler(
lexicographicMode=False,
)
for (errorIndication, errorStatus, errorIndex, varBinds) in g:
if not _any_failure_happened(errorIndication, errorStatus, errorIndex, varBinds):
if not _any_failure_happened(
errorIndication, errorStatus, errorIndex, varBinds
):
# Bulk operation returns array of varbinds
for varbind in varBinds:
logger.debug(f"Bulk returned this varbind: {varbind}")
Expand Down

0 comments on commit 883b5a4

Please sign in to comment.