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

make version['latch'] optional

parent 330d2f60
No related branches found
No related tags found
No related merge requests found
...@@ -18,10 +18,12 @@ def after_request(resp): ...@@ -18,10 +18,12 @@ def after_request(resp):
@common.require_accepts_json @common.require_accepts_json
def version(): def version():
config = current_app.config["INVENTORY_PROVIDER_CONFIG"] config = current_app.config["INVENTORY_PROVIDER_CONFIG"]
version_params = {
return jsonify({
'api': API_VERSION, 'api': API_VERSION,
'module': 'module':
pkg_resources.get_distribution('inventory_provider').version, pkg_resources.get_distribution('inventory_provider').version
'latch': get_latch(get_current_redis(config)) }
}) latch = get_latch(get_current_redis(config))
if latch:
version_params['latch'] = latch
return jsonify(version_params)
...@@ -141,15 +141,6 @@ def flask_config_filename(): ...@@ -141,15 +141,6 @@ def flask_config_filename():
@pytest.fixture @pytest.fixture
def mocked_redis(mocker): def mocked_redis(mocker):
MockedRedis().db['db:latch'] = json.dumps({
'current': 0,
'next': 0,
'this': 0,
'pending': False,
'failure': False
})
mocker.patch( mocker.patch(
'inventory_provider.tasks.common.redis.StrictRedis', 'inventory_provider.tasks.common.redis.StrictRedis',
MockedRedis) MockedRedis)
......
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