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

pep8

parent e3555d3a
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,7 @@ TASK_LOG_SCHEMA = {
'additionalProperties': False
}
def get_latch(r):
latch = r.get('db:latch')
if latch is None:
......
......@@ -111,7 +111,8 @@ def snmp_refresh_interfaces(self, hostname, community):
def netconf_refresh_config(self, hostname):
try:
netconf_doc = juniper.load_config(hostname, InventoryTask.config["ssh"])
netconf_doc = juniper.load_config(
hostname, InventoryTask.config["ssh"])
netconf_str = etree.tostring(netconf_doc, encoding='unicode')
except ConnectionError:
msg = f'error loading netconf data from {hostname}'
......
......@@ -21,6 +21,7 @@ TEST_LOG_EVENTS = [
{'type': 'task-error', 'uuid': 'AAAA', 'clock': 777}
]
@contextlib.contextmanager
def mocked_connection():
yield CONNECTION_FINGERPRINT
......@@ -56,8 +57,10 @@ def backend_db():
@mock.patch('inventory_provider.tasks.monitor.app.events.State', MockedState)
@mock.patch('inventory_provider.tasks.monitor.app.connection', mocked_connection)
@mock.patch('inventory_provider.tasks.monitor.app.events.Receiver', MockedReceiver)
@mock.patch(
'inventory_provider.tasks.monitor.app.connection', mocked_connection)
@mock.patch(
'inventory_provider.tasks.monitor.app.events.Receiver', MockedReceiver)
def test_latchdb(data_config_filename, mocked_redis):
os.environ['INVENTORY_PROVIDER_CONFIG_FILENAME'] = data_config_filename
......
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