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

Commit

Permalink
fix: lint (ADDON-39580)
Browse files Browse the repository at this point in the history
- sanitizers (formatting)
  • Loading branch information
lstoppa committed Aug 10, 2021
1 parent 047424d commit 6d07fd3
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

()
import logging

from splunk_connect_for_snmp_poller.manager.realtime.interface_mib import InterfaceMib
from splunk_connect_for_snmp_poller.manager.realtime.interface_mib import (
InterfaceMib,
)
from splunk_connect_for_snmp_poller.utilities import multi_key_lookup

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion splunk_connect_for_snmp_poller/manager/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def sort_varbinds(varbind_list: list) -> VarbindCollection:


# TODO remove the debugging statement later
#@app.task
@app.task
def snmp_polling(
host, version, community, profile, server_config, index, one_time_flag=False
):
Expand Down
2 changes: 1 addition & 1 deletion splunk_connect_for_snmp_poller/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ def multi_key_lookup(dictionary, tuple_of_keys):

try:
return reduce(dict.get, tuple_of_keys, dictionary)
except TypeError as error:
except TypeError:
return None
6 changes: 3 additions & 3 deletions tests/test_interface_mib.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def file_data_path(data_file_name):

class TestInterfaceMib(TestCase):
def test_loaded_walk_data_for_if_mib(self):
file_path = file_data_path("if_mib_walk.json")
file_path = file_data_path("if_mib_walk.json.data")
if_mibs = load_test_data(file_path)
self.assertIsNotNone(if_mibs)

Expand All @@ -61,8 +61,8 @@ def test_loaded_walk_data_for_if_mib(self):

def test_walk_data_with_wrong_number_of_interfaces(self):
for invalid_data_file in [
"if_mib_walk_invalid_networks.json",
"if_mib_walk_invalid_indexes.json",
"if_mib_walk_invalid_networks.json.data",
"if_mib_walk_invalid_indexes.json.data",
]:
file_path = file_data_path(invalid_data_file)
if_mibs = load_test_data(file_path)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_static_config_data_for_network_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#
from unittest import TestCase

from splunk_connect_for_snmp_poller.manager.realtime.interface_mib import InterfaceMib
from splunk_connect_for_snmp_poller.manager.realtime.interface_mib import (
InterfaceMib,
)
from splunk_connect_for_snmp_poller.manager.static.interface_mib_utililities import (
extract_network_interface_data_from_config,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def fake_walk_handler(simulator_ifmib_walk_data):


if __name__ == "__main__":
file_path = "mib_walk_data/if_mib_walk.json"
file_path = "mib_walk_data/if_mib_walk.json.data"

for metric in fake_walk_handler(load_test_data(file_path)):
print(f"{metric}")

0 comments on commit 6d07fd3

Please sign in to comment.