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):
@common.require_accepts_json
def version():
config = current_app.config["INVENTORY_PROVIDER_CONFIG"]
return jsonify({
version_params = {
'api': API_VERSION,
'module':
pkg_resources.get_distribution('inventory_provider').version,
'latch': get_latch(get_current_redis(config))
})
pkg_resources.get_distribution('inventory_provider').version
}
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():
@pytest.fixture
def mocked_redis(mocker):
MockedRedis().db['db:latch'] = json.dumps({
'current': 0,
'next': 0,
'this': 0,
'pending': False,
'failure': False
})
mocker.patch(
'inventory_provider.tasks.common.redis.StrictRedis',
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