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

don't call router_details.update_router_details

parent d7504798
No related branches found
No related tags found
No related merge requests found
import logging
from flask import Blueprint, Response, current_app
from inventory_provider import router_details
from inventory_provider.tasks.app import app
from inventory_provider.constants import TASK_LOGGER_NAME
routes = Blueprint("inventory-data-job-routes", __name__)
@routes.route("/update", methods=['GET', 'POST'])
def update():
router_details.update_network_details(
current_app.config["INVENTORY_PROVIDER_CONFIG"])
task_logger = logging.getLogger(TASK_LOGGER_NAME)
config = current_app.config["INVENTORY_PROVIDER_CONFIG"]
for r in config["routers"]:
task_logger.info("fetching router details for: %r" % r)
task_logger.debug('launching task: '
'inventory_provider'
'.tasks.worker.netconf_refresh_config'
'(%s)' % r['hostname'])
app.send_task(
'inventory_provider.tasks.worker.netconf_refresh_config',
args=[r["hostname"]])
return Response("OK")
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