Load config options
Rally < 0.12 loads only inner config options, so we need to load rally-openstack options manually. Hope, Rally 0.12 will fix the issue. Change-Id: Ib19c58b15229874a27187ab036dc982a1fd9d803
This commit is contained in:
parent
6158c1139c
commit
75ab0a28ea
@ -0,0 +1,29 @@
|
|||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
from rally.common import version as _rally_version
|
||||||
|
|
||||||
|
_version_tuple = _rally_version.version_info.semantic_version().version_tuple()
|
||||||
|
|
||||||
|
if _version_tuple < (0, 12):
|
||||||
|
# NOTE(andreykurilin): Rally < 0.12 doesn't care about loading options from
|
||||||
|
# external packages, so we need to handle it manually.
|
||||||
|
|
||||||
|
from rally.common import opts as global_opts
|
||||||
|
|
||||||
|
from rally_openstack.cfg import opts
|
||||||
|
|
||||||
|
# ensure that rally options are registered.
|
||||||
|
global_opts.register()
|
||||||
|
global_opts.register_opts(opts.list_opts().items())
|
@ -31,6 +31,7 @@ setup-hooks =
|
|||||||
[entry_points]
|
[entry_points]
|
||||||
rally_plugins =
|
rally_plugins =
|
||||||
path = rally_openstack
|
path = rally_openstack
|
||||||
|
options = rally_openstack.cfg.opts:list_opts
|
||||||
|
|
||||||
[build_sphinx]
|
[build_sphinx]
|
||||||
all_files = 1
|
all_files = 1
|
||||||
|
@ -591,18 +591,14 @@ def check_opts_import_path(logical_line, physical_line, filename):
|
|||||||
|
|
||||||
N342
|
N342
|
||||||
"""
|
"""
|
||||||
excluded_files = ["./rally/task/engine.py",
|
excluded_files = ["./rally_openstack/__init__.py"]
|
||||||
"./rally/task/context.py",
|
|
||||||
"./rally/task/scenario.py",
|
|
||||||
"./rally/common/opts.py"]
|
|
||||||
forbidden_methods = [".register_opts("]
|
forbidden_methods = [".register_opts("]
|
||||||
|
|
||||||
if filename not in excluded_files:
|
if filename not in excluded_files:
|
||||||
for forbidden_method in forbidden_methods:
|
for forbidden_method in forbidden_methods:
|
||||||
if logical_line.find(forbidden_method) != -1:
|
if logical_line.find(forbidden_method) != -1:
|
||||||
yield (0, "N342 All options should be loaded from correct "
|
yield (0, "N342 All options should be loaded from correct "
|
||||||
"paths only. For 'openstack' "
|
"paths only - rally_openstack.cfg module.")
|
||||||
"its './rally/plugin/openstack/cfg'")
|
|
||||||
|
|
||||||
|
|
||||||
def factory(register):
|
def factory(register):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user