Skip to content
Snippets Groups Projects
Commit 01afae14 authored by Erik Reid's avatar Erik Reid
Browse files

pep8

parent 5e9efd42
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,7 @@ def snmp_ids(hostname):
ifc_data = json.loads(ifc_data_string.decode('utf-8'))
result = [
{ 'index': i['index'], 'name': _ifc_name(i)}
{'index': i['index'], 'name': _ifc_name(i)}
for i in ifc_data]
return Response(
json.dumps(result),
......
......@@ -104,4 +104,3 @@ def test_get_interface_status(mocker, client):
response = json.loads(rv.data.decode("utf-8"))
jsonschema.validate(response, interfaces_list_schema)
assert response == {"status": "up"}
......@@ -278,7 +278,6 @@ def test_snmp_ids(client_with_mocked_data):
}
}
for hostname in _routers(client_with_mocked_data):
rv = client_with_mocked_data.post(
"/data/snmp/" + hostname,
......
......@@ -8,51 +8,6 @@ import pytest
from inventory_provider import snmp
from inventory_provider import config
# CACHE_SCHEMA = {
# "$schema": "http://json-schema.org/draft-07/schema#",
# "type": "object",
# "patternProperties": {
# "^.*\\.geant\\.net$": {
# "type": "object",
# "properties": {
# "bgp": {"type": "object"},
# "vrr": {"type": "object"},
# "interfaces": {"type": "object"},
# "snmp-interfaces": {
# "type": "array",
# "items": {
# "type": "object",
# "properties": {
# "v4Address": {"type": "string"},
# "v4Mask": {"type": "string"},
# "v4InterfaceName": {"type": "string"},
# "v6Address": {"type": "string"},
# "v6Mask": {"type": "string"},
# "v6InterfaceName": {"type": "string"},
# },
# "additionalProperties": False
# }
# }
# },
# "required": ["bgp", "vrr", "interfaces", "snmp-interfaces"],
# "additionalProperties": False
# }
# },
# "additionalProperties": False
# }
#
# def mocked_walk(agent_hostname, community, base_oid):
# return [e for e in SNMP_WALK_DATA if e['oid'].startswith(base_oid)]
# # for e in SNMP_WALK_DATA:
# # if e['oid'].startswith(base_oid):
# # yield e
# # json.dumps
# # {"oid": ".1.3.6.1.2.1.55.1.5.1.2.1442", "value": "ae15.112"}
OID_TEST_CONFIG = """#
# This file is located in dbupdates/conf and is used by scripts under dbupdates/scripts.
# It holds OID values for retrieving details of a router.
......@@ -66,7 +21,9 @@ v4Mask=.1.3.6.1.2.1.4.20.1.3
## IPv6
v6AddressAndMask=.1.3.6.1.2.1.55.1.8.1.2
v6InterfaceName=.1.3.6.1.2.1.55.1.5.1.2"""
v6InterfaceName=.1.3.6.1.2.1.55.1.5.1.2
""" # noqa E501
@pytest.fixture
def snmp_walk_responses():
......@@ -127,4 +84,3 @@ def test_snmp_interfaces(mocker, oid_config, snmp_walk_responses):
and 'v6InterfaceName' in ifc:
continue
assert False, "address details not found in interface dict"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment