From 31ac1b72f2e0d84f11feb9942ad1cf715a3e2bc8 Mon Sep 17 00:00:00 2001
From: Sam Betts <sam@code-smash.net>
Date: Mon, 3 Jul 2017 16:20:15 +0100
Subject: [PATCH] switch from oslosphinx to openstackdocstheme

Change-Id: I2f1f8f76b6ec732a770707a259dc72a2f576e46c
---
 doc/source/conf.py          | 19 +++++++++++++++----
 releasenotes/source/conf.py | 17 +++++++++++++++--
 test-requirements.txt       |  1 -
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/doc/source/conf.py b/doc/source/conf.py
index b7f4a7d34e..3266fc0ef9 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -21,9 +21,19 @@ extensions = ['sphinx.ext.autodoc',
               'sphinxcontrib.pecanwsme.rest',
               'sphinxcontrib.seqdiag',
               'wsmeext.sphinxext',
-              'oslosphinx',
               ]
 
+try:
+    import openstackdocstheme
+    extensions.append('openstackdocstheme')
+except ImportError:
+    openstackdocstheme = None
+
+repository_name = 'openstack/ironic'
+bug_project = 'ironic'
+bug_tag = ''
+html_last_updated_fmt = '%Y-%m-%d %H:%M'
+
 wsme_protocols = ['restjson']
 
 # autodoc generation is a bit aggressive and a nuisance when doing heavy
@@ -81,9 +91,10 @@ suppress_warnings = [ 'app.add_directive']
 
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
 # Sphinx are currently 'default' and 'sphinxdoc'.
-# html_theme_path = ["."]
-# html_theme = '_theme'
-# html_static_path = ['_static']
+if openstackdocstheme is not None:
+    html_theme = 'openstackdocs'
+else:
+    html_theme = 'default'
 
 # Output file base name for HTML help builder.
 htmlhelp_basename = '%sdoc' % project
diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py
index 254c050fbf..1e6fc7e3b8 100644
--- a/releasenotes/source/conf.py
+++ b/releasenotes/source/conf.py
@@ -38,10 +38,20 @@
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
 extensions = [
-    'oslosphinx',
     'reno.sphinxext',
 ]
 
+try:
+    import openstackdocstheme
+    extensions.append('openstackdocstheme')
+except ImportError:
+    openstackdocstheme = None
+
+repository_name = 'openstack/ironic'
+bug_project = 'ironic'
+bug_tag = ''
+html_last_updated_fmt = '%Y-%m-%d %H:%M'
+
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
@@ -112,7 +122,10 @@ pygments_style = 'sphinx'
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-html_theme = 'default'
+if openstackdocstheme is not None:
+    html_theme = 'openstackdocs'
+else:
+    html_theme = 'default'
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
diff --git a/test-requirements.txt b/test-requirements.txt
index 4edb548fe5..d97733500d 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -26,6 +26,5 @@ sphinx>=1.6.2 # BSD
 sphinxcontrib-pecanwsme>=0.8 # Apache-2.0
 sphinxcontrib-seqdiag # BSD
 openstackdocstheme>=1.11.0 # Apache-2.0
-oslosphinx>=4.7.0 # Apache-2.0
 reno!=2.3.1,>=1.8.0 # Apache-2.0
 os-api-ref>=1.0.0 # Apache-2.0