diff --git a/etc/rally/rally.conf.sample b/etc/rally/rally.conf.sample index f567e4ef..f6d2effe 100644 --- a/etc/rally/rally.conf.sample +++ b/etc/rally/rally.conf.sample @@ -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 diff --git a/rally/plugins/openstack/cfg/cinder.py b/rally/plugins/openstack/cfg/cinder.py index b87c4742..e1f07217 100644 --- a/rally/plugins/openstack/cfg/cinder.py +++ b/rally/plugins/openstack/cfg/cinder.py @@ -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", diff --git a/rally/plugins/openstack/cfg/cleanup.py b/rally/plugins/openstack/cfg/cleanup.py index 02c60298..1a18bc29 100644 --- a/rally/plugins/openstack/cfg/cleanup.py +++ b/rally/plugins/openstack/cfg/cleanup.py @@ -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", diff --git a/rally/plugins/openstack/cfg/ec2.py b/rally/plugins/openstack/cfg/ec2.py index 67d6e6dc..b7580277 100644 --- a/rally/plugins/openstack/cfg/ec2.py +++ b/rally/plugins/openstack/cfg/ec2.py @@ -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( diff --git a/rally/plugins/openstack/cfg/glance.py b/rally/plugins/openstack/cfg/glance.py index 66c0e0a0..a6170f52 100644 --- a/rally/plugins/openstack/cfg/glance.py +++ b/rally/plugins/openstack/cfg/glance.py @@ -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", diff --git a/rally/plugins/openstack/cfg/heat.py b/rally/plugins/openstack/cfg/heat.py index 7cccda49..b8979f4d 100644 --- a/rally/plugins/openstack/cfg/heat.py +++ b/rally/plugins/openstack/cfg/heat.py @@ -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", diff --git a/rally/plugins/openstack/cfg/ironic.py b/rally/plugins/openstack/cfg/ironic.py index 3fce98f8..a0f3c62a 100644 --- a/rally/plugins/openstack/cfg/ironic.py +++ b/rally/plugins/openstack/cfg/ironic.py @@ -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", diff --git a/rally/plugins/openstack/cfg/keystone_roles.py b/rally/plugins/openstack/cfg/keystone_roles.py index 785dbdc8..47481631 100644 --- a/rally/plugins/openstack/cfg/keystone_roles.py +++ b/rally/plugins/openstack/cfg/keystone_roles.py @@ -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", diff --git a/rally/plugins/openstack/cfg/keystone_users.py b/rally/plugins/openstack/cfg/keystone_users.py index 5a67ff73..1a88aa73 100644 --- a/rally/plugins/openstack/cfg/keystone_users.py +++ b/rally/plugins/openstack/cfg/keystone_users.py @@ -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": [ diff --git a/rally/plugins/openstack/cfg/magnum.py b/rally/plugins/openstack/cfg/magnum.py index 6915317b..174bd683 100644 --- a/rally/plugins/openstack/cfg/magnum.py +++ b/rally/plugins/openstack/cfg/magnum.py @@ -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", diff --git a/rally/plugins/openstack/cfg/manila.py b/rally/plugins/openstack/cfg/manila.py index 0712ee4a..86614dca 100644 --- a/rally/plugins/openstack/cfg/manila.py +++ b/rally/plugins/openstack/cfg/manila.py @@ -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( diff --git a/rally/plugins/openstack/cfg/mistral.py b/rally/plugins/openstack/cfg/mistral.py index 5202aef4..6c5abdb1 100644 --- a/rally/plugins/openstack/cfg/mistral.py +++ b/rally/plugins/openstack/cfg/mistral.py @@ -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( diff --git a/rally/plugins/openstack/cfg/monasca.py b/rally/plugins/openstack/cfg/monasca.py index 46ea4acb..0f461ee0 100644 --- a/rally/plugins/openstack/cfg/monasca.py +++ b/rally/plugins/openstack/cfg/monasca.py @@ -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( diff --git a/rally/plugins/openstack/cfg/murano.py b/rally/plugins/openstack/cfg/murano.py index 52c2731b..965167f1 100644 --- a/rally/plugins/openstack/cfg/murano.py +++ b/rally/plugins/openstack/cfg/murano.py @@ -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", diff --git a/rally/plugins/openstack/cfg/neutron.py b/rally/plugins/openstack/cfg/neutron.py index eba3ef3c..ad7dc2f3 100644 --- a/rally/plugins/openstack/cfg/neutron.py +++ b/rally/plugins/openstack/cfg/neutron.py @@ -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", diff --git a/rally/plugins/openstack/cfg/nova.py b/rally/plugins/openstack/cfg/nova.py index 39f23d67..23269fbf 100644 --- a/rally/plugins/openstack/cfg/nova.py +++ b/rally/plugins/openstack/cfg/nova.py @@ -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 diff --git a/rally/plugins/openstack/cfg/osclients.py b/rally/plugins/openstack/cfg/osclients.py index 05b58862..ce9ab0ff 100644 --- a/rally/plugins/openstack/cfg/osclients.py +++ b/rally/plugins/openstack/cfg/osclients.py @@ -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 = { diff --git a/rally/plugins/openstack/cfg/profiler.py b/rally/plugins/openstack/cfg/profiler.py index a87555be..06362cbd 100644 --- a/rally/plugins/openstack/cfg/profiler.py +++ b/rally/plugins/openstack/cfg/profiler.py @@ -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", diff --git a/rally/plugins/openstack/cfg/sahara.py b/rally/plugins/openstack/cfg/sahara.py index 51e17122..4123fea8 100644 --- a/rally/plugins/openstack/cfg/sahara.py +++ b/rally/plugins/openstack/cfg/sahara.py @@ -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", diff --git a/rally/plugins/openstack/cfg/senlin.py b/rally/plugins/openstack/cfg/senlin.py index 58287ff8..e5490e1c 100644 --- a/rally/plugins/openstack/cfg/senlin.py +++ b/rally/plugins/openstack/cfg/senlin.py @@ -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", diff --git a/rally/plugins/openstack/cfg/tempest.py b/rally/plugins/openstack/cfg/tempest.py index 2c6c693b..9806b16b 100644 --- a/rally/plugins/openstack/cfg/tempest.py +++ b/rally/plugins/openstack/cfg/tempest.py @@ -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", diff --git a/rally/plugins/openstack/cfg/vm.py b/rally/plugins/openstack/cfg/vm.py index 1fa5c008..8fb6f214 100644 --- a/rally/plugins/openstack/cfg/vm.py +++ b/rally/plugins/openstack/cfg/vm.py @@ -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", diff --git a/rally/plugins/openstack/cfg/watcher.py b/rally/plugins/openstack/cfg/watcher.py index f6082714..615bf1b1 100644 --- a/rally/plugins/openstack/cfg/watcher.py +++ b/rally/plugins/openstack/cfg/watcher.py @@ -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", diff --git a/rally/plugins/openstack/cleanup/base.py b/rally/plugins/openstack/cleanup/base.py index 0bb3a946..7623058d 100644 --- a/rally/plugins/openstack/cleanup/base.py +++ b/rally/plugins/openstack/cleanup/base.py @@ -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 diff --git a/rally/plugins/openstack/cleanup/resources.py b/rally/plugins/openstack/cleanup/resources.py index 170b8feb..b0d62e3c 100644 --- a/rally/plugins/openstack/cleanup/resources.py +++ b/rally/plugins/openstack/cleanup/resources.py @@ -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 diff --git a/rally/plugins/openstack/context/glance/images.py b/rally/plugins/openstack/context/glance/images.py index 53d2c7af..95e26f14 100644 --- a/rally/plugins/openstack/context/glance/images.py +++ b/rally/plugins/openstack/context/glance/images.py @@ -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 diff --git a/rally/plugins/openstack/context/keystone/roles.py b/rally/plugins/openstack/context/keystone/roles.py index 69fd83c0..9c516703 100644 --- a/rally/plugins/openstack/context/keystone/roles.py +++ b/rally/plugins/openstack/context/keystone/roles.py @@ -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 diff --git a/rally/plugins/openstack/context/keystone/users.py b/rally/plugins/openstack/context/keystone/users.py index 283fd611..073ba19d 100644 --- a/rally/plugins/openstack/context/keystone/users.py +++ b/rally/plugins/openstack/context/keystone/users.py @@ -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 diff --git a/rally/plugins/openstack/context/manila/manila_security_services.py b/rally/plugins/openstack/context/manila/manila_security_services.py index 905d00d2..adabcc13 100644 --- a/rally/plugins/openstack/context/manila/manila_security_services.py +++ b/rally/plugins/openstack/context/manila/manila_security_services.py @@ -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 diff --git a/rally/plugins/openstack/context/manila/manila_share_networks.py b/rally/plugins/openstack/context/manila/manila_share_networks.py index dafa5350..ef15d527 100644 --- a/rally/plugins/openstack/context/manila/manila_share_networks.py +++ b/rally/plugins/openstack/context/manila/manila_share_networks.py @@ -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 diff --git a/rally/plugins/openstack/context/manila/manila_shares.py b/rally/plugins/openstack/context/manila/manila_shares.py index 654ab761..fe9b59f7 100644 --- a/rally/plugins/openstack/context/manila/manila_shares.py +++ b/rally/plugins/openstack/context/manila/manila_shares.py @@ -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 diff --git a/rally/plugins/openstack/context/sahara/sahara_cluster.py b/rally/plugins/openstack/context/sahara/sahara_cluster.py index f75ec3e0..9e288451 100644 --- a/rally/plugins/openstack/context/sahara/sahara_cluster.py +++ b/rally/plugins/openstack/context/sahara/sahara_cluster.py @@ -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 diff --git a/rally/plugins/openstack/osclients.py b/rally/plugins/openstack/osclients.py index a6851031..c781258d 100644 --- a/rally/plugins/openstack/osclients.py +++ b/rally/plugins/openstack/osclients.py @@ -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 diff --git a/rally/plugins/openstack/platforms/existing.py b/rally/plugins/openstack/platforms/existing.py index a84f6c94..71c7bef6 100644 --- a/rally/plugins/openstack/platforms/existing.py +++ b/rally/plugins/openstack/platforms/existing.py @@ -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 diff --git a/rally/plugins/openstack/scenario.py b/rally/plugins/openstack/scenario.py index 1da63e8d..ad1c36c3 100644 --- a/rally/plugins/openstack/scenario.py +++ b/rally/plugins/openstack/scenario.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/cinder/utils.py b/rally/plugins/openstack/scenarios/cinder/utils.py index 662f23f4..7e2c4f87 100644 --- a/rally/plugins/openstack/scenarios/cinder/utils.py +++ b/rally/plugins/openstack/scenarios/cinder/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/ec2/utils.py b/rally/plugins/openstack/scenarios/ec2/utils.py index da661b6c..70d60da3 100644 --- a/rally/plugins/openstack/scenarios/ec2/utils.py +++ b/rally/plugins/openstack/scenarios/ec2/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/glance/utils.py b/rally/plugins/openstack/scenarios/glance/utils.py index fc2ed5a3..1c10af68 100644 --- a/rally/plugins/openstack/scenarios/glance/utils.py +++ b/rally/plugins/openstack/scenarios/glance/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/heat/utils.py b/rally/plugins/openstack/scenarios/heat/utils.py index 7d6184c0..5f083f46 100644 --- a/rally/plugins/openstack/scenarios/heat/utils.py +++ b/rally/plugins/openstack/scenarios/heat/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/ironic/utils.py b/rally/plugins/openstack/scenarios/ironic/utils.py index 8e09ba31..ae45893a 100644 --- a/rally/plugins/openstack/scenarios/ironic/utils.py +++ b/rally/plugins/openstack/scenarios/ironic/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/magnum/utils.py b/rally/plugins/openstack/scenarios/magnum/utils.py index 64947221..d1e76d7f 100644 --- a/rally/plugins/openstack/scenarios/magnum/utils.py +++ b/rally/plugins/openstack/scenarios/magnum/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/manila/utils.py b/rally/plugins/openstack/scenarios/manila/utils.py index 555795f1..73b00c75 100644 --- a/rally/plugins/openstack/scenarios/manila/utils.py +++ b/rally/plugins/openstack/scenarios/manila/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/mistral/utils.py b/rally/plugins/openstack/scenarios/mistral/utils.py index aff1b1bf..147c414c 100644 --- a/rally/plugins/openstack/scenarios/mistral/utils.py +++ b/rally/plugins/openstack/scenarios/mistral/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/monasca/utils.py b/rally/plugins/openstack/scenarios/monasca/utils.py index 6d5e1930..8b609a11 100644 --- a/rally/plugins/openstack/scenarios/monasca/utils.py +++ b/rally/plugins/openstack/scenarios/monasca/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/murano/utils.py b/rally/plugins/openstack/scenarios/murano/utils.py index 49d7c01f..84ca3c5f 100644 --- a/rally/plugins/openstack/scenarios/murano/utils.py +++ b/rally/plugins/openstack/scenarios/murano/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/neutron/utils.py b/rally/plugins/openstack/scenarios/neutron/utils.py index ca3e29b3..e0532e2f 100644 --- a/rally/plugins/openstack/scenarios/neutron/utils.py +++ b/rally/plugins/openstack/scenarios/neutron/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/nova/utils.py b/rally/plugins/openstack/scenarios/nova/utils.py index 0ae03964..40bec27a 100644 --- a/rally/plugins/openstack/scenarios/nova/utils.py +++ b/rally/plugins/openstack/scenarios/nova/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/sahara/utils.py b/rally/plugins/openstack/scenarios/sahara/utils.py index 7ad8d5ca..4ca8e408 100644 --- a/rally/plugins/openstack/scenarios/sahara/utils.py +++ b/rally/plugins/openstack/scenarios/sahara/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/senlin/utils.py b/rally/plugins/openstack/scenarios/senlin/utils.py index 12d1d866..fd905fbe 100644 --- a/rally/plugins/openstack/scenarios/senlin/utils.py +++ b/rally/plugins/openstack/scenarios/senlin/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/vm/utils.py b/rally/plugins/openstack/scenarios/vm/utils.py index 44537a1b..536bc0ee 100644 --- a/rally/plugins/openstack/scenarios/vm/utils.py +++ b/rally/plugins/openstack/scenarios/vm/utils.py @@ -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 diff --git a/rally/plugins/openstack/scenarios/watcher/utils.py b/rally/plugins/openstack/scenarios/watcher/utils.py index 51b86c96..ce29d3e7 100644 --- a/rally/plugins/openstack/scenarios/watcher/utils.py +++ b/rally/plugins/openstack/scenarios/watcher/utils.py @@ -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 diff --git a/rally/plugins/openstack/services/heat/main.py b/rally/plugins/openstack/services/heat/main.py index 75b97d4d..af2c429b 100644 --- a/rally/plugins/openstack/services/heat/main.py +++ b/rally/plugins/openstack/services/heat/main.py @@ -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 diff --git a/rally/plugins/openstack/services/image/glance_v1.py b/rally/plugins/openstack/services/image/glance_v1.py index d0d4b13a..a7f979ed 100644 --- a/rally/plugins/openstack/services/image/glance_v1.py +++ b/rally/plugins/openstack/services/image/glance_v1.py @@ -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 diff --git a/rally/plugins/openstack/services/image/glance_v2.py b/rally/plugins/openstack/services/image/glance_v2.py index fcd4d0d0..575e2c36 100644 --- a/rally/plugins/openstack/services/image/glance_v2.py +++ b/rally/plugins/openstack/services/image/glance_v2.py @@ -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 diff --git a/rally/plugins/openstack/services/image/image.py b/rally/plugins/openstack/services/image/image.py index b58f3da2..86a940af 100644 --- a/rally/plugins/openstack/services/image/image.py +++ b/rally/plugins/openstack/services/image/image.py @@ -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 diff --git a/rally/plugins/openstack/services/storage/block.py b/rally/plugins/openstack/services/storage/block.py index 9263790d..8a74fde0 100644 --- a/rally/plugins/openstack/services/storage/block.py +++ b/rally/plugins/openstack/services/storage/block.py @@ -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 diff --git a/rally/plugins/openstack/verification/tempest/config.py b/rally/plugins/openstack/verification/tempest/config.py index 8f090ac4..4bf08387 100644 --- a/rally/plugins/openstack/verification/tempest/config.py +++ b/rally/plugins/openstack/verification/tempest/config.py @@ -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 diff --git a/rally/plugins/openstack/wrappers/glance.py b/rally/plugins/openstack/wrappers/glance.py index 271224b7..b0c70533 100644 --- a/rally/plugins/openstack/wrappers/glance.py +++ b/rally/plugins/openstack/wrappers/glance.py @@ -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__) diff --git a/rally/plugins/openstack/wrappers/network.py b/rally/plugins/openstack/wrappers/network.py index f8382609..fe14ce2b 100644 --- a/rally/plugins/openstack/wrappers/network.py +++ b/rally/plugins/openstack/wrappers/network.py @@ -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 diff --git a/tests/hacking/checks.py b/tests/hacking/checks.py index eb349249..b9408937 100644 --- a/tests/hacking/checks.py +++ b/tests/hacking/checks.py @@ -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) diff --git a/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py b/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py index ff2d5c15..3ed20e49 100644 --- a/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py +++ b/tests/unit/plugins/openstack/context/sahara/test_sahara_cluster.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py b/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py index 576f584f..63d4f7b1 100644 --- a/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/cinder/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/ec2/test_utils.py b/tests/unit/plugins/openstack/scenarios/ec2/test_utils.py index e988f9bb..69a241bf 100644 --- a/tests/unit/plugins/openstack/scenarios/ec2/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/ec2/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/murano/test_utils.py b/tests/unit/plugins/openstack/scenarios/murano/test_utils.py index 6917ed1e..311dd69c 100644 --- a/tests/unit/plugins/openstack/scenarios/murano/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/murano/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/nova/test_utils.py b/tests/unit/plugins/openstack/scenarios/nova/test_utils.py index 9aae02e4..6c5257e3 100644 --- a/tests/unit/plugins/openstack/scenarios/nova/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/nova/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py b/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py index 340f75e1..ae0552c7 100644 --- a/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py +++ b/tests/unit/plugins/openstack/scenarios/sahara/test_jobs.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py b/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py index 10e818c4..65b85070 100644 --- a/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/sahara/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/senlin/test_utils.py b/tests/unit/plugins/openstack/scenarios/senlin/test_utils.py index 4fd020d3..5ca9c86c 100644 --- a/tests/unit/plugins/openstack/scenarios/senlin/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/senlin/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/vm/test_utils.py b/tests/unit/plugins/openstack/scenarios/vm/test_utils.py index 69f149b5..ee8bd743 100644 --- a/tests/unit/plugins/openstack/scenarios/vm/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/vm/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py b/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py index 2bbc9823..6e3dc3b3 100644 --- a/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py +++ b/tests/unit/plugins/openstack/scenarios/watcher/test_utils.py @@ -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 diff --git a/tests/unit/plugins/openstack/services/storage/test_cinder_common.py b/tests/unit/plugins/openstack/services/storage/test_cinder_common.py index 8ecdcaed..b66e70e2 100644 --- a/tests/unit/plugins/openstack/services/storage/test_cinder_common.py +++ b/tests/unit/plugins/openstack/services/storage/test_cinder_common.py @@ -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 diff --git a/tests/unit/plugins/openstack/services/storage/test_cinder_v1.py b/tests/unit/plugins/openstack/services/storage/test_cinder_v1.py index 7c0ace27..b2a13027 100644 --- a/tests/unit/plugins/openstack/services/storage/test_cinder_v1.py +++ b/tests/unit/plugins/openstack/services/storage/test_cinder_v1.py @@ -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 diff --git a/tests/unit/plugins/openstack/services/storage/test_cinder_v2.py b/tests/unit/plugins/openstack/services/storage/test_cinder_v2.py index c34c962c..c3857f29 100644 --- a/tests/unit/plugins/openstack/services/storage/test_cinder_v2.py +++ b/tests/unit/plugins/openstack/services/storage/test_cinder_v2.py @@ -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 diff --git a/tests/unit/plugins/openstack/test_osclients.py b/tests/unit/plugins/openstack/test_osclients.py index 27b71749..1c0ad545 100644 --- a/tests/unit/plugins/openstack/test_osclients.py +++ b/tests/unit/plugins/openstack/test_osclients.py @@ -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 diff --git a/tests/unit/plugins/openstack/verification/tempest/test_config.py b/tests/unit/plugins/openstack/verification/tempest/test_config.py index a59dce3f..f08ed441 100644 --- a/tests/unit/plugins/openstack/verification/tempest/test_config.py +++ b/tests/unit/plugins/openstack/verification/tempest/test_config.py @@ -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 diff --git a/tests/unit/plugins/openstack/verification/tempest/test_context.py b/tests/unit/plugins/openstack/verification/tempest/test_context.py index 50f262d3..cc767901 100644 --- a/tests/unit/plugins/openstack/verification/tempest/test_context.py +++ b/tests/unit/plugins/openstack/verification/tempest/test_context.py @@ -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 diff --git a/tests/unit/plugins/openstack/wrappers/test_glance.py b/tests/unit/plugins/openstack/wrappers/test_glance.py index 98fa5e17..02f926f4 100644 --- a/tests/unit/plugins/openstack/wrappers/test_glance.py +++ b/tests/unit/plugins/openstack/wrappers/test_glance.py @@ -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 diff --git a/tests/unit/test.py b/tests/unit/test.py index 6933b436..f1aa20ed 100644 --- a/tests/unit/test.py +++ b/tests/unit/test.py @@ -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()