summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2020-09-10 15:58:12 +0100
committerStephen Finucane <sfinucan@redhat.com>2020-09-10 16:36:46 +0100
commit01f63b875e6534a90ded876c88115f8e5eb0c7f6 (patch)
tree9f475c0f2f7b03b0f2b688e9bfd528122c258545
parentfcb88941e39a31e3ef6c5a930063da419431a7f6 (diff)
downloadoslo-config-01f63b875e6534a90ded876c88115f8e5eb0c7f6.tar.gz
sphinxext: Add 'merge_domaindata'
This is necessary to enable parallel builds. As noted in the Sphinx docs [1], this method has the following function: Merge in data regarding docnames from a different domaindata inventory (coming from a subprocess in parallel builds). Given how simple the datatypes we're storing are, this is pretty easy to implement. [1] https://www.sphinx-doc.org/en/master/extdev/domainapi.html#sphinx.domains.Domain.merge_domaindata Change-Id: I46c7903b159f99c68896a4c3c4d20daef848f9c2 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Closes-Bug: #1895162
-rw-r--r--oslo_config/sphinxext.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/oslo_config/sphinxext.py b/oslo_config/sphinxext.py
index 4a11163..6aadf73 100644
--- a/oslo_config/sphinxext.py
+++ b/oslo_config/sphinxext.py
@@ -495,6 +495,15 @@ class ConfigDomain(Domain):
)
return None
+ def merge_domaindata(self, docnames, otherdata):
+ for target, docname in otherdata['options'].items():
+ if docname in docnames:
+ self.data['options'][target] = docname
+
+ for target, docname in otherdata['groups'].items():
+ if docname in docnames:
+ self.data['groups'][target] = docname
+
def setup(app):
# NOTE(dhellmann): Try to turn off lazy translation from oslo_i18n