[docs] Use proper reference for openstack plugins
* add rally-openstack package to doc requirements * fix linking for plugins (with hardcoding openstack plugins) * move importing of osclients to inner methods Change-Id: Ifb851c61de01e4140c23b447b5e0d55c1e76fb1c
This commit is contained in:
parent
44aaa7dfed
commit
8eaed0befe
@ -306,7 +306,15 @@ class PluginsReferenceDirective(rst.Directive):
|
||||
section_obj.extend(utils.parse_text(section))
|
||||
|
||||
filename = info["module"].replace(".", "/")
|
||||
ref = "https://github.com/openstack/rally/blob/master/%s.py" % filename
|
||||
if filename.startswith("rally/"):
|
||||
project = "rally"
|
||||
elif filename.startswith("rally_openstack/"):
|
||||
project = "rally-openstack"
|
||||
else:
|
||||
# WTF is it?!
|
||||
return None
|
||||
ref = ("https://github.com/openstack/%s/blob/master/%s.py"
|
||||
% (project, filename))
|
||||
section_obj.extend(utils.parse_text("**Module**:\n`%s`__\n\n__ %s"
|
||||
% (info["module"], ref)))
|
||||
return section_obj
|
||||
@ -336,6 +344,7 @@ class PluginsReferenceDirective(rst.Directive):
|
||||
name += word
|
||||
return name
|
||||
|
||||
@plugins.ensure_plugins_are_loaded
|
||||
def _get_all_plugins_bases(self):
|
||||
"""Return grouped and sorted all plugins bases."""
|
||||
bases = []
|
||||
@ -357,7 +366,6 @@ class PluginsReferenceDirective(rst.Directive):
|
||||
return sorted(bases)
|
||||
|
||||
def run(self):
|
||||
plugins.load()
|
||||
bases = self._get_all_plugins_bases()
|
||||
if "base_cls" in self.options:
|
||||
for _category_name, base_name, base_cls in bases:
|
||||
|
3
doc/requirements.txt
Normal file
3
doc/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
rally-openstack
|
||||
# we are using theme from it
|
||||
oslosphinx
|
@ -14,7 +14,6 @@
|
||||
# under the License.
|
||||
|
||||
from rally.common import logging
|
||||
from rally.plugins.openstack import osclients
|
||||
|
||||
LOG = logging.getLogger(__file__)
|
||||
|
||||
@ -87,6 +86,8 @@ class OpenStackCredential(dict):
|
||||
# this method is mostly used by validation step. let's refactor it and
|
||||
# deprecated this
|
||||
def clients(self, api_info=None):
|
||||
from rally.plugins.openstack import osclients
|
||||
|
||||
return osclients.Clients(self, api_info=api_info,
|
||||
cache=self._clients_cache)
|
||||
|
||||
|
@ -22,7 +22,6 @@ import six
|
||||
|
||||
from rally.common.plugin import plugin
|
||||
from rally import exceptions
|
||||
from rally.plugins.openstack import osclients
|
||||
from rally.task import scenario
|
||||
|
||||
|
||||
@ -86,6 +85,8 @@ def preprocess(name, context, args):
|
||||
and resource configuration
|
||||
|
||||
"""
|
||||
from rally.plugins.openstack import osclients
|
||||
|
||||
preprocessors = scenario.Scenario.get(name)._meta_get("preprocessors",
|
||||
default={})
|
||||
|
||||
|
@ -95,7 +95,7 @@ class ConvertTestCase(test.TestCase):
|
||||
class PreprocessTestCase(test.TestCase):
|
||||
|
||||
@mock.patch("rally.task.types.scenario.Scenario.get")
|
||||
@mock.patch("rally.task.types.osclients")
|
||||
@mock.patch("rally.plugins.openstack.osclients")
|
||||
def test_preprocess(self, mock_osclients, mock_scenario_get):
|
||||
|
||||
name = "some_plugin"
|
||||
|
Loading…
x
Reference in New Issue
Block a user