summaryrefslogtreecommitdiff
path: root/oslo_policy/sphinxext.py
diff options
context:
space:
mode:
authorDoug Hellmann <doug@doughellmann.com>2017-07-28 13:37:12 -0400
committerLance Bragstad <lbragstad@gmail.com>2017-07-31 16:25:38 +0000
commit4b2342a9fe71ca47282b302372df594157c5da2f (patch)
treeebf25a80a0659201060fc782e18f5677e40d38ab /oslo_policy/sphinxext.py
parent2b99c39c30df432fe79cbfe3db0f21039e324fb4 (diff)
downloadoslo-policy-4b2342a9fe71ca47282b302372df594157c5da2f.tar.gz
throw an exception when sphinxext cannot find the config file
Using the app error function is not enough to break the build at the point where the error occurs. Throw an exception with an error message explaining the problem. Related-Bug: 1707246 Change-Id: Ie836b7a6f3ea7cba1737913b944f36c77f14cfd0 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Diffstat (limited to 'oslo_policy/sphinxext.py')
-rw-r--r--oslo_policy/sphinxext.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/oslo_policy/sphinxext.py b/oslo_policy/sphinxext.py
index dcb8471..00b90c8 100644
--- a/oslo_policy/sphinxext.py
+++ b/oslo_policy/sphinxext.py
@@ -124,7 +124,9 @@ class ShowPolicyDirective(rst.Directive):
config_path = c
break
else:
- self.error('could not find config file in: %s' % str(candidates))
+ raise ValueError(
+ 'could not find config file in: %s' % str(candidates)
+ )
self.info('loading config file %s' % config_path)