diff --git a/inventory_provider/routes/testing.py b/inventory_provider/routes/testing.py index 7405a52ede724b65e76bea4e7d45f286376fc709..6c4d655a2f136dc0c3bda0d727a124effffedfa4 100644 --- a/inventory_provider/routes/testing.py +++ b/inventory_provider/routes/testing.py @@ -1,5 +1,6 @@ import collections import json +import os import re from flask import Blueprint, Response, jsonify, current_app @@ -219,6 +220,12 @@ def get_netconf(hostname): return msg +@routes.route("routers-list", methods=['GET', 'POST']) +def routers_from_config_dir(): + with open(os.environ['FAKE_ROUTERS_FILE']) as f: + return Response(f.read(), mimetype="text.plain") + + @routes.route("latchdb", methods=['GET', 'POST']) def latch_db(): config = current_app.config["INVENTORY_PROVIDER_CONFIG"]