From c93f4853f69fd8243e2d603fe901b7dccd075c70 Mon Sep 17 00:00:00 2001
From: Christian Schwede <cschwede@redhat.com>
Date: Fri, 2 Dec 2016 16:26:11 +0000
Subject: [PATCH] Make hooks module import optional

There is no hooks module available when running the
extract_swift_flags.py locally, so making this import optional.

Change-Id: I65ebacd1e3e4cf66ece0a9fcbbc785d79278e8bb
---
 autogenerate_config_docs/autohelp.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/autogenerate_config_docs/autohelp.py b/autogenerate_config_docs/autohelp.py
index b402d8f8..00cfba83 100755
--- a/autogenerate_config_docs/autohelp.py
+++ b/autogenerate_config_docs/autohelp.py
@@ -36,7 +36,10 @@ except Exception:
     pass
 
 sys.path.insert(0, '.')
-from hooks import HOOKS  # noqa
+try:
+    from hooks import HOOKS  # noqa
+except ImportError:
+    pass
 
 
 EXTENSIONS = ['oslo.cache',