From 883b5a42c4c15e9faad86736688a8f6d01fe2a06 Mon Sep 17 00:00:00 2001 From: omrozowicz-splunk Date: Mon, 9 Aug 2021 12:08:54 +0200 Subject: [PATCH] format task_utilities file --- .../manager/task_utilities.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/splunk_connect_for_snmp_poller/manager/task_utilities.py b/splunk_connect_for_snmp_poller/manager/task_utilities.py index a83a38a..8f0594f 100644 --- a/splunk_connect_for_snmp_poller/manager/task_utilities.py +++ b/splunk_connect_for_snmp_poller/manager/task_utilities.py @@ -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( @@ -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: @@ -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}")