Merge "[cfg] Introduce rally.common.cfg"

This commit is contained in:
Zuul 2018-02-12 19:27:51 +00:00 committed by Gerrit Code Review
commit d619116f63
78 changed files with 109 additions and 105 deletions

View File

@ -794,3 +794,8 @@
# Neutron create loadbalancer poll interval (floating point value)
#neutron_create_loadbalancer_poll_interval = 2.0
# Whether Neutron API is older then OpenStack Newton or not. Based in
# this option, some external fields for identifying resources can be
# applied. (boolean value)
#pre_newton_neutron = false

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("cinder_volume_create_prepoll_delay",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.IntOpt("resource_deletion_timeout",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt(

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("glance_image_delete_timeout",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("heat_stack_create_prepoll_delay",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("ironic_node_create_poll_interval",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.IntOpt("roles_context_resource_management_workers",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("magnum_cluster_create_prepoll_delay",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt(

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.IntOpt(

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt(

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.IntOpt("murano_deploy_environment_timeout",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("neutron_create_loadbalancer_timeout",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
# prepoll delay, timeout, poll interval

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.BoolOpt("enable_profiler",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.IntOpt("sahara_cluster_create_timeout",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("senlin_action_timeout",

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.StrOpt("img_url",

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("vm_ping_poll_interval",

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
OPTS = {"openstack": [
cfg.FloatOpt("watcher_audit_launch_poll_interval",

View File

@ -14,8 +14,7 @@
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.task import utils
CONF = cfg.CONF

View File

@ -16,9 +16,9 @@
from boto import exception as boto_exception
from neutronclient.common import exceptions as neutron_exceptions
from novaclient import exceptions as nova_exc
from oslo_config import cfg
from saharaclient.api import base as saharaclient_base
from rally.common import cfg
from rally.common import logging
from rally.plugins.openstack.cleanup import base
from rally.plugins.openstack.services.identity import identity

View File

@ -12,8 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import logging
from rally.common import utils as rutils
from rally.common import validation

View File

@ -13,9 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import broker
from rally.common import cfg
from rally.common import logging
from rally.common import validation
from rally import consts

View File

@ -16,9 +16,8 @@
import collections
import uuid
from oslo_config import cfg
from rally.common import broker
from rally.common import cfg
from rally.common import logging
from rally.common import utils as rutils
from rally.common import validation

View File

@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import utils
from rally.common import validation
from rally import consts as rally_consts

View File

@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import logging
from rally.common import utils
from rally.common import validation

View File

@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import utils
from rally.common import validation
from rally import consts as rally_consts

View File

@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import utils as rutils
from rally.common import validation
from rally import consts

View File

@ -16,10 +16,10 @@
import abc
import os
from oslo_config import cfg
from six.moves.urllib import parse
from rally.cli import envutils
from rally.common import cfg
from rally.common import logging
from rally.common.plugin import plugin
from rally.common import utils

View File

@ -16,8 +16,7 @@ import copy
import json
import traceback
from oslo_config import cfg
from rally.common import cfg
from rally.common import logging
from rally.env import platform
from rally.plugins.openstack import osclients

View File

@ -16,8 +16,9 @@
import functools
import random
from oslo_config import cfg
from osprofiler import profiler
from rally.common import cfg
from rally.common.plugin import plugin
from rally.plugins.openstack import osclients
from rally.task import context

View File

@ -15,8 +15,7 @@
import random
from oslo_config import cfg
from rally.common import cfg
from rally.common import logging
from rally import exceptions
from rally.plugins.openstack import scenario

View File

@ -13,8 +13,7 @@
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack import scenario
from rally.task import atomic
from rally.task import utils

View File

@ -13,8 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import logging
from rally.plugins.openstack import scenario
from rally.plugins.openstack.wrappers import glance as glance_wrapper

View File

@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
import requests
from rally.common import cfg
from rally.common import logging
from rally import exceptions
from rally.plugins.openstack import scenario

View File

@ -15,8 +15,7 @@
import string
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack import scenario
from rally.task import atomic
from rally.task import utils

View File

@ -17,12 +17,12 @@ import random
import string
import time
from oslo_config import cfg
from kubernetes import client as k8s_config
from kubernetes.client import api_client
from kubernetes.client.apis import core_v1_api
from kubernetes.client.rest import ApiException
from rally.common import cfg
from rally.common import utils as common_utils
from rally import exceptions
from rally.plugins.openstack import scenario

View File

@ -15,8 +15,7 @@
import random
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack.context.manila import consts
from rally.plugins.openstack import scenario

View File

@ -14,9 +14,9 @@
# under the License.
from oslo_config import cfg
import yaml
from rally.common import cfg
from rally.plugins.openstack import scenario
from rally.task import atomic
from rally.task import utils

View File

@ -16,8 +16,7 @@ import random
import time
import uuid
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack import scenario
from rally.task import atomic

View File

@ -19,9 +19,9 @@ import tempfile
import uuid
import zipfile
from oslo_config import cfg
import yaml
from rally.common import cfg
from rally.common import fileutils
from rally.common import utils as common_utils
from rally.plugins.openstack import scenario

View File

@ -15,8 +15,7 @@
import random
from oslo_config import cfg
from rally.common import cfg
from rally.common import logging
from rally import exceptions
from rally.plugins.openstack import scenario

View File

@ -14,8 +14,7 @@
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import logging
from rally import exceptions
from rally.plugins.openstack import scenario

View File

@ -15,10 +15,10 @@
import random
from oslo_config import cfg
from oslo_utils import uuidutils
from saharaclient.api import base as sahara_base
from rally.common import cfg
from rally.common import logging
from rally.common import utils as rutils
from rally import consts

View File

@ -10,8 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack import scenario
from rally.task import atomic

View File

@ -18,9 +18,9 @@ import subprocess
import sys
import netaddr
from oslo_config import cfg
import six
from rally.common import cfg
from rally.common import logging
from rally.common import sshutils
from rally.plugins.openstack.scenarios.nova import utils as nova_utils

View File

@ -10,8 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack import scenario
from rally.task import atomic
from rally.task import utils

View File

@ -11,8 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.common import utils as common_utils
from rally.task import atomic
from rally.task import utils

View File

@ -14,8 +14,7 @@
import os
from oslo_config import cfg
from rally.common import cfg
from rally.common import utils as rutils
from rally.plugins.openstack import service
from rally.plugins.openstack.services.image import glance_common

View File

@ -15,9 +15,9 @@
import os
import time
from oslo_config import cfg
import requests
from rally.common import cfg
from rally.common import utils as rutils
from rally.plugins.openstack import service
from rally.plugins.openstack.services.image import glance_common

View File

@ -11,10 +11,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from rally.common import cfg
from rally import exceptions
from rally.task import service
from oslo_config import cfg
CONF = cfg.CONF

View File

@ -12,8 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from rally.common import cfg
from rally.task import service

View File

@ -16,10 +16,10 @@
import inspect
import os
from oslo_config import cfg
import six
from six.moves import configparser
from rally.common import cfg
from rally.common import logging
from rally import exceptions
from rally.verification import utils

View File

@ -17,15 +17,16 @@ import abc
import os
import time
from glanceclient import exc as glance_exc
import requests
import six
from rally.common import cfg
from rally.common import logging
from rally.common import utils as rutils
from rally import exceptions
from rally.task import utils
from glanceclient import exc as glance_exc
from oslo_config import cfg
import requests
import six
LOG = logging.getLogger(__name__)

View File

@ -16,9 +16,9 @@
import abc
import netaddr
from oslo_config import cfg
import six
from rally.common import cfg
from rally.common import logging
from rally.common import utils
from rally import consts

View File

@ -177,6 +177,25 @@ def check_import_of_logging(logical_line, physical_line, filename):
"use `rally.common.logging` instead.")
@skip_ignored_lines
def check_import_of_config(logical_line, physical_line, filename):
"""Check correctness import of config module
N311
"""
excluded_files = ["./rally/common/cfg.py"]
forbidden_imports = ["from oslo_config",
"import oslo_config"]
if filename not in excluded_files:
for forbidden_import in forbidden_imports:
if logical_line.startswith(forbidden_import):
yield (0, "N311 Wrong module for config is imported. Please "
"use `rally.common.cfg` instead.")
@skip_ignored_lines
def no_use_conf_debug_check(logical_line, physical_line, filename):
"""Check for "cfg.CONF.debug"
@ -572,8 +591,7 @@ def check_opts_import_path(logical_line, physical_line, filename):
N342
"""
excluded_files = ["./rally/osclients.py",
"./rally/task/engine.py",
excluded_files = ["./rally/task/engine.py",
"./rally/task/context.py",
"./rally/task/scenario.py",
"./rally/common/opts.py"]
@ -590,6 +608,7 @@ def check_opts_import_path(logical_line, physical_line, filename):
def factory(register):
register(check_assert_methods_from_mock)
register(check_import_of_logging)
register(check_import_of_config)
register(no_use_conf_debug_check)
register(assert_true_instance)
register(assert_equal_type)

View File

@ -13,8 +13,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack.context.sahara import sahara_cluster
from rally.plugins.openstack.scenarios.sahara import utils as sahara_utils

View File

@ -14,8 +14,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack import osclients
from rally.plugins.openstack.scenarios.cinder import utils

View File

@ -13,8 +13,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack.scenarios.ec2 import utils
from tests.unit import test

View File

@ -14,8 +14,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack.scenarios.murano import utils
from tests.unit import test

View File

@ -15,8 +15,8 @@
import ddt
import mock
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions as rally_exceptions
from rally.plugins.openstack.scenarios.nova import utils
from tests.unit import fakes

View File

@ -14,8 +14,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack.scenarios.sahara import jobs
from tests.unit import test

View File

@ -14,10 +14,10 @@
# under the License.
import mock
from oslo_config import cfg
from oslo_utils import uuidutils
from saharaclient.api import base as sahara_base
from rally.common import cfg
from rally import consts
from rally import exceptions
from rally.plugins.openstack.scenarios.sahara import utils

View File

@ -11,8 +11,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack.scenarios.senlin import utils
from tests.unit import test

View File

@ -18,8 +18,8 @@ import subprocess
import mock
import netaddr
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack.scenarios.vm import utils
from tests.unit import test

View File

@ -14,8 +14,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack.scenarios.watcher import utils
from tests.unit import test

View File

@ -16,8 +16,8 @@ import uuid
import ddt
import mock
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack import service
from rally.plugins.openstack.services.storage import block

View File

@ -13,8 +13,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack.services.storage import cinder_v1
from tests.unit import fakes
from tests.unit import test

View File

@ -13,8 +13,8 @@
# under the License.
import mock
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack.services.storage import cinder_v2
from tests.unit import fakes
from tests.unit import test

View File

@ -15,8 +15,8 @@
import ddt
import mock
from oslo_config import cfg
from rally.common import cfg
from rally import consts
from rally import exceptions
from rally import osclients as deprecated_osclients # noqa

View File

@ -15,8 +15,8 @@
import ddt
import mock
from oslo_config import cfg
from rally.common import cfg
from rally.plugins.openstack import osclients
from rally.plugins.openstack.verification.tempest import config
from tests.unit import fakes

View File

@ -17,9 +17,9 @@ import os
import ddt
import mock
from oslo_config import cfg
import requests
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack.verification.tempest import config
from rally.plugins.openstack.verification.tempest import context

View File

@ -18,8 +18,8 @@ import tempfile
import ddt
from glanceclient import exc as glance_exc
import mock
from oslo_config import cfg
from rally.common import cfg
from rally import exceptions
from rally.plugins.openstack.wrappers import glance as glance_wrapper
from tests.unit import test

View File

@ -18,15 +18,15 @@ import os
import uuid
import mock
from oslo_config import fixture
from oslotest import base
from rally.common import cfg
from rally.common import db
from rally import plugins
from tests.unit import fakes
class DatabaseFixture(fixture.Config):
class DatabaseFixture(cfg.fixture.Config):
"""Create clean DB before starting test."""
def setUp(self):
super(DatabaseFixture, self).setUp()