Browse Source

Fix keystone warnings while building docs

When building the documentation via run_tests.sh, doc/source/conf.py
explicitly sets the DJANGO_SETTINGS_MODULE environment variable,
overriding any existing value that it already has. Furthermore, it sets
it to point to a settings file that does not use keystone v3, which
is expected by the tests (and is the source of the warning).  Note that
when running unit tests via run_tests.sh, a different settings file is
supplied which DOES use keystone v3.

Change the doc/source/conf.py to only set DJANGO_SETTINGS_MODULE if it
is not already set.  Change tox.ini and run_tests.sh to set
DJANGO_SETTINGS_MODULE to the same settings file used by the unit tests,
with keystone v3 support.

Change-Id: Ib297e4188f2426cf575300998bc9d50f36e48f4f
Closes-Bug: #1257725
tags/2014.2.b2
Gary W. Smith 5 years ago
parent
commit
1f38f87138
3 changed files with 3 additions and 3 deletions
  1. 1
    1
      doc/source/conf.py
  2. 1
    1
      run_tests.sh
  3. 1
    1
      tox.ini

+ 1
- 1
doc/source/conf.py View File

@@ -33,7 +33,7 @@ ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
33 33
 sys.path.insert(0, ROOT)
34 34
 
35 35
 # This is required for ReadTheDocs.org, but isn't a bad idea anyway.
36
-os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
36
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'openstack_dashboard.settings')
37 37
 
38 38
 import horizon.version
39 39
 

+ 1
- 1
run_tests.sh View File

@@ -158,7 +158,7 @@ function run_pep8 {
158 158
 
159 159
 function run_sphinx {
160 160
     echo "Building sphinx..."
161
-    ${command_wrapper} python setup.py build_sphinx
161
+    DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings ${command_wrapper} python setup.py build_sphinx
162 162
     echo "Build complete."
163 163
 }
164 164
 

+ 1
- 1
tox.ini View File

@@ -45,7 +45,7 @@ basepython = python2.6
45 45
 commands = /bin/bash run_tests.sh -N --integration {posargs}
46 46
 
47 47
 [testenv:docs]
48
-setenv = DJANGO_SETTINGS_MODULE=openstack_auth.tests.settings
48
+setenv = DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
49 49
 commands = python setup.py build_sphinx
50 50
 
51 51
 [tox:jenkins]

Loading…
Cancel
Save