From 7d7d189545db1f4da39777fab5e60359cbf917e6 Mon Sep 17 00:00:00 2001 From: Saad Zaher Date: Thu, 12 May 2016 09:36:07 +0000 Subject: [PATCH] Added .gitreview Change-Id: I42f5bbb4a6bc12445c3ea571134a614395b0fd34 --- .gitignore | 6 +++ .gitreview | 4 ++ doc/.gitignore | 3 -- doc/source/_static/test.css | 47 +++++++++++++++++++++ doc/source/index.rst | 8 ++++ freezer_dr/common/osclient.py | 4 +- freezer_dr/monitors/drivers/dummy/driver.py | 6 +-- freezer_dr/notifiers/common/manager.py | 2 +- requirements.txt | 1 + setup.cfg | 2 + test-requirements.txt | 3 +- tox.ini | 4 ++ 12 files changed, 80 insertions(+), 10 deletions(-) create mode 100644 .gitreview delete mode 100644 doc/.gitignore create mode 100644 doc/source/_static/test.css diff --git a/.gitignore b/.gitignore index a4f688c..75c91c0 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,9 @@ ChangeLog # Coverage data .coverage.* + +# sphinx +doc/source/_static/nova.conf.sample +doc/source/api/* +doc/build/* + diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..8558820 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack/freezer-dr.git diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 4c2e299..0000000 --- a/doc/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build/ -source/ref/ -source/api/ diff --git a/doc/source/_static/test.css b/doc/source/_static/test.css new file mode 100644 index 0000000..8daf641 --- /dev/null +++ b/doc/source/_static/test.css @@ -0,0 +1,47 @@ + +.sp_feature_mandatory { + font-weight: bold; +} + +.sp_feature_optional { +} + +.sp_feature_choice { + font-style: italic; + font-weight: bold; +} + +.sp_feature_condition { + font-style: italic; + font-weight: bold; +} + + +.sp_impl_complete { + color: rgb(0, 120, 0); + font-weight: normal; +} + +.sp_impl_missing { + color: rgb(120, 0, 0); + font-weight: normal; +} + +.sp_impl_partial { + color: rgb(170, 170, 0); + font-weight: normal; +} + +.sp_impl_unknown { + color: rgb(170, 170, 170); + font-weight: normal; +} + +.sp_impl_summary { + font-size: 2em; +} + +.sp_cli { + font-family: monospace; + background-color: #F5F5F5; +} diff --git a/doc/source/index.rst b/doc/source/index.rst index 55db2db..39c6d8d 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -19,3 +19,11 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` + +.. toctree:: + :maxdepth: 1 + + api/autoindex + +.. toctree:: + :hidden: \ No newline at end of file diff --git a/freezer_dr/common/osclient.py b/freezer_dr/common/osclient.py index 857d679..e198a81 100644 --- a/freezer_dr/common/osclient.py +++ b/freezer_dr/common/osclient.py @@ -164,8 +164,8 @@ class OSClient: return auth_session def get_node_status(self, node): - """Check the node nova-service status and if it's disabled or not. - + """ + Check the node nova-service status and if it's disabled or not. :param node: dict contains node info :return: True or False. True => node disabled, False => node is enabled or unknow status ! diff --git a/freezer_dr/monitors/drivers/dummy/driver.py b/freezer_dr/monitors/drivers/dummy/driver.py index 384f521..1bea064 100644 --- a/freezer_dr/monitors/drivers/dummy/driver.py +++ b/freezer_dr/monitors/drivers/dummy/driver.py @@ -15,12 +15,12 @@ from freezer_dr.monitors.common.driver import MonitorBaseDriver class DummyDriver(MonitorBaseDriver): - """ A monitoring driver that returns a configured list of nodes as failed. - + """ + A monitoring driver that returns a configured list of nodes as failed. This can be useful for testing without actually shutting down the nodes. The nodes that should be reported as failing, can be configured in the monitoring section of the freezer_dr configuration file as follows: - kwargs = nodes_down:hostname1;hostname2 + kwargs = nodes_down:hostname1;hostname2 """ def __init__(self, username, password, endpoint, **kwargs): diff --git a/freezer_dr/notifiers/common/manager.py b/freezer_dr/notifiers/common/manager.py index 1e5f3d4..5c455b2 100644 --- a/freezer_dr/notifiers/common/manager.py +++ b/freezer_dr/notifiers/common/manager.py @@ -38,7 +38,7 @@ class NotificationManager(object): def notify(self, nodes, status): """ Send Notification to users added on tenants that has VMs running on the - affected host. + affected host. :param nodes: List of hosts that are affected, contains instances running on those hosts, tenants, users added on those tenants. :param status: success or error diff --git a/requirements.txt b/requirements.txt index 5cd7dfe..769de38 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ oslo.utils>=1.4.0,!=1.4.1,<1.5.0 oslo.log>=1.0.0,<1.1.0 # Apache-2.0 libvirt-python>=1.2.5 Jinja2>=2.6 + diff --git a/setup.cfg b/setup.cfg index 3833423..d59b925 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,8 @@ build-dir = doc/build all_files = 1 [pbr] +# Have pbr generate the module indexes like sphinx autodoc +autodoc_index_modules = True warnerrors = True diff --git a/test-requirements.txt b/test-requirements.txt index 3a42bae..c91e273 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -14,4 +14,5 @@ python-subunit>=0.0.18 pyflakes==0.8.1 testrepository>=0.0.18 testtools>=0.9.36,!=1.2.0,<2.0.0 - +oslosphinx>=2.5.0,!=3.4.0 # Apache-2.0 +sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 # BSD diff --git a/tox.ini b/tox.ini index b9ce1c5..885ab7f 100644 --- a/tox.ini +++ b/tox.ini @@ -30,6 +30,10 @@ norecursedirs = .tox .venv [testenv:venv] commands = {posargs} +[testenv:docs] +commands = + python setup.py build_sphinx + [testenv:py27] basepython = python2.7 setenv =