# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1485343088 -3600
#      Wed Jan 25 12:18:08 2017 +0100
# Node ID 418cc00ec3e8e9d151e66663e976d1fd20e436d5
# Parent  d91a368a788c3d353ad0368c0b749284c40d901f
[hooks] if index-name is not configured, skip hook

diff --git a/hooks.py b/hooks.py
--- a/hooks.py
+++ b/hooks.py
@@ -54,7 +54,7 @@
     def precommit_event(self):
         indexer = self.cnx.vreg['es'].select('indexer', self.cnx)
         es = indexer.get_connection()
-        if es is None:
+        if es is None or not self.cnx.vreg.config['index-name']:
             log.info('no connection to ES (not configured) skip ES indexing')
             return
         for entity in self.get_data():