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

put correct module version in /version response

parent d46115b9
No related branches found
No related tags found
No related merge requests found
import functools
import json
import pkg_resources
from flask import Blueprint, request, Response, current_app
from lxml import etree
......@@ -9,10 +10,7 @@ from inventory_provider import juniper
routes = Blueprint("inventory-data-query-routes", __name__)
VERSION = {
"api": "0.1",
"module": "0.1"
}
API_VERSION = '0.1'
def require_accepts_json(f):
......@@ -37,8 +35,17 @@ def require_accepts_json(f):
@routes.route("/version", methods=['GET', 'POST'])
@require_accepts_json
def version():
VERSION = {
"api": "0.1",
"module": "0.1"
}
return Response(
json.dumps(VERSION),
json.dumps({
'api': API_VERSION,
'module':
pkg_resources.get_distribution('inventory_provider').version
}),
mimetype="application/json"
)
......
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