Merge "Move files to common lib(Part 4)"

This commit is contained in:
Jenkins 2015-01-12 12:47:47 +00:00 committed by Gerrit Code Review
commit 3a0e9b20f8
59 changed files with 72 additions and 71 deletions

View File

@ -1,7 +1,7 @@
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.common import log as logging
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -15,7 +15,7 @@
import pecan import pecan
from rally import log as logging from rally.common import log as logging
def setup_app(config): def setup_app(config):

View File

@ -17,10 +17,10 @@ import jsonschema
from rally.benchmark import engine from rally.benchmark import engine
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally import consts from rally import consts
from rally import deploy from rally import deploy
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import objects from rally import objects
from rally.verification.tempest import tempest from rally.verification.tempest import tempest

View File

@ -18,9 +18,9 @@ import abc
import jsonschema import jsonschema
import six import six
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,10 +18,10 @@ import sys
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.benchmark.context.cleanup import manager from rally.benchmark.context.cleanup import manager
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,8 +18,8 @@ import time
from rally.benchmark.context.cleanup import base from rally.benchmark.context.cleanup import base
from rally.common import broker from rally.common import broker
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -18,7 +18,7 @@ from neutronclient.common import exceptions as neutron_exceptions
from rally.benchmark.context.cleanup import base from rally.benchmark.context.cleanup import base
from rally.benchmark.scenarios.keystone import utils as kutils from rally.benchmark.scenarios.keystone import utils as kutils
from rally.benchmark.wrappers import keystone as keystone_wrapper from rally.benchmark.wrappers import keystone as keystone_wrapper
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -14,9 +14,9 @@
# under the License. # under the License.
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -17,9 +17,9 @@ from rally.benchmark.context.cleanup import manager as resource_manager
from rally.benchmark.scenarios import base as scenario_base from rally.benchmark.scenarios import base as scenario_base
from rally.benchmark.scenarios.glance import utils as glance_utils from rally.benchmark.scenarios.glance import utils as glance_utils
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -18,8 +18,8 @@ import novaclient.exceptions
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.benchmark.context.cleanup import manager as resource_manager from rally.benchmark.context.cleanup import manager as resource_manager
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -18,9 +18,9 @@ import six
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.benchmark.wrappers import network as network_wrapper from rally.benchmark.wrappers import network as network_wrapper
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,9 +19,9 @@ from rally.benchmark.context.quotas import designate_quotas
from rally.benchmark.context.quotas import neutron_quotas from rally.benchmark.context.quotas import neutron_quotas
from rally.benchmark.context.quotas import nova_quotas from rally.benchmark.context.quotas import nova_quotas
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -15,10 +15,10 @@
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -21,10 +21,10 @@ from rally.benchmark.scenarios.sahara import utils
from rally.benchmark import types from rally.benchmark import types
from rally.benchmark import utils as bench_utils from rally.benchmark import utils as bench_utils
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -18,10 +18,10 @@ import requests
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.benchmark.context.cleanup import manager as resource_manager from rally.benchmark.context.cleanup import manager as resource_manager
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -17,9 +17,9 @@ from rally.benchmark.context.cleanup import manager as resource_manager
from rally.benchmark.scenarios import base as scenarios_base from rally.benchmark.scenarios import base as scenarios_base
from rally.benchmark.scenarios.glance import utils as glance_utils from rally.benchmark.scenarios.glance import utils as glance_utils
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -17,8 +17,8 @@ import six
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -17,9 +17,9 @@ from rally.benchmark.context.cleanup import manager as resource_manager
from rally.benchmark.scenarios.nova import utils as nova_utils from rally.benchmark.scenarios.nova import utils as nova_utils
from rally.benchmark import types as types from rally.benchmark import types as types
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -20,9 +20,9 @@ import tempfile
from rally.benchmark.context import base from rally.benchmark.context import base
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally.verification.tempest import config from rally.verification.tempest import config
from rally.verification.tempest import tempest from rally.verification.tempest import tempest

View File

@ -23,10 +23,10 @@ from rally.benchmark import utils
from rally.benchmark.wrappers import keystone from rally.benchmark.wrappers import keystone
from rally.common import broker from rally.common import broker
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import objects from rally import objects
from rally import osclients from rally import osclients

View File

@ -17,9 +17,9 @@ from rally.benchmark.context.cleanup import manager as resource_manager
from rally.benchmark.scenarios import base as scenario_base from rally.benchmark.scenarios import base as scenario_base
from rally.benchmark.scenarios.cinder import utils as cinder_utils from rally.benchmark.scenarios.cinder import utils as cinder_utils
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -27,10 +27,10 @@ from rally.benchmark.runners import base as base_runner
from rally.benchmark.scenarios import base as base_scenario from rally.benchmark.scenarios import base as base_scenario
from rally.benchmark.sla import base as base_sla from rally.benchmark.sla import base as base_sla
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import objects from rally import objects
from rally import osclients from rally import osclients

View File

@ -23,10 +23,10 @@ import six
from rally.benchmark.scenarios import base as scenario_base from rally.benchmark.scenarios import base as scenario_base
from rally.benchmark import types from rally.benchmark import types
from rally.benchmark import utils from rally.benchmark import utils
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import osclients from rally import osclients

View File

@ -21,8 +21,8 @@ from six import moves
from rally.benchmark.runners import base from rally.benchmark.runners import base
from rally.benchmark import utils from rally.benchmark import utils
from rally.common import log as logging
from rally import consts from rally import consts
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,8 +19,8 @@ import threading
import time import time
from rally.benchmark.runners import base from rally.benchmark.runners import base
from rally.common import log as logging
from rally import consts from rally import consts
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -20,10 +20,10 @@ import random
import string import string
import time import time
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,8 +18,8 @@ from rally.benchmark.scenarios.cinder import utils
from rally.benchmark.scenarios.nova import utils as nova_utils from rally.benchmark.scenarios.nova import utils as nova_utils
from rally.benchmark import types as types from rally.benchmark import types as types
from rally.benchmark import validation from rally.benchmark import validation
from rally.common import log as logging
from rally import consts from rally import consts
from rally import log as logging
import random import random

View File

@ -17,7 +17,7 @@ from oslo.utils import uuidutils as uid
from rally.benchmark.scenarios import base from rally.benchmark.scenarios import base
from rally.benchmark.wrappers import network as network_wrapper from rally.benchmark.wrappers import network as network_wrapper
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -21,9 +21,9 @@ from rally.benchmark.scenarios.nova import utils
from rally.benchmark.scenarios import utils as scenario_utils from rally.benchmark.scenarios import utils as scenario_utils
from rally.benchmark import types as types from rally.benchmark import types as types
from rally.benchmark import validation from rally.benchmark import validation
from rally.common import log as logging
from rally import consts from rally import consts
from rally import exceptions as rally_exceptions from rally import exceptions as rally_exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -17,8 +17,8 @@ from rally.benchmark.scenarios import base
from rally.benchmark.scenarios.sahara import utils from rally.benchmark.scenarios.sahara import utils
from rally.benchmark import types from rally.benchmark import types
from rally.benchmark import validation from rally.benchmark import validation
from rally.common import log as logging
from rally import consts from rally import consts
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -16,8 +16,8 @@
from rally.benchmark.scenarios import base from rally.benchmark.scenarios import base
from rally.benchmark.scenarios.sahara import utils from rally.benchmark.scenarios.sahara import utils
from rally.benchmark import validation from rally.benchmark import validation
from rally.common import log as logging
from rally import consts from rally import consts
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -21,9 +21,9 @@ from saharaclient.api import base as sahara_base
from rally.benchmark.scenarios import base from rally.benchmark.scenarios import base
from rally.benchmark import utils as bench_utils from rally.benchmark import utils as bench_utils
from rally.common import log as logging
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -21,8 +21,8 @@ from novaclient import exceptions as nova_exc
from novaclient.v1_1 import servers from novaclient.v1_1 import servers
import six import six
from rally.common import log as logging
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,9 +18,9 @@ import abc
import netaddr import netaddr
import six import six
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import consts from rally import consts
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -23,7 +23,7 @@ from oslo.config import cfg
from rally.aas.rest import app as rally_app from rally.aas.rest import app as rally_app
from rally.common.i18n import _ from rally.common.i18n import _
from rally import log as logging from rally.common import log as logging
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -25,10 +25,10 @@ from oslo.config import cfg
import six import six
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally.common import version from rally.common import version
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally.openstack.common import cliutils from rally.openstack.common import cliutils

View File

@ -32,11 +32,11 @@ from rally.cmd import cliutils
from rally.cmd.commands import use from rally.cmd.commands import use
from rally.cmd import envutils from rally.cmd import envutils
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils from rally.common import utils as rutils
from rally import consts from rally import consts
from rally import db from rally import db
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import objects from rally import objects
from rally.openstack.common import cliutils as common_cliutils from rally.openstack.common import cliutils as common_cliutils

View File

@ -18,7 +18,7 @@ import threading
import time import time
from rally.common.i18n import _ from rally.common.i18n import _
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -65,7 +65,7 @@ import paramiko
import six import six
from rally.common.i18n import _ from rally.common.i18n import _
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -30,8 +30,8 @@ from sphinx.util import docstrings
import rally import rally
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,11 +19,11 @@ import jsonschema
import six import six
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import consts from rally import consts
from rally.deploy.serverprovider import provider from rally.deploy.serverprovider import provider
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,11 +18,11 @@ import os
import six import six
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import consts from rally import consts
from rally.deploy import engine from rally.deploy import engine
from rally.deploy.serverprovider import provider from rally.deploy.serverprovider import provider
from rally import log as logging
from rally import objects from rally import objects

View File

@ -19,12 +19,12 @@ import netaddr
import six import six
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally.deploy import engine from rally.deploy import engine
from rally.deploy.serverprovider import provider from rally.deploy.serverprovider import provider
from rally.deploy.serverprovider.providers import lxc from rally.deploy.serverprovider.providers import lxc
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import objects from rally import objects
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,7 +19,7 @@ import time
import requests import requests
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -22,10 +22,10 @@ import six
from six import moves from six import moves
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally.deploy.serverprovider import provider from rally.deploy.serverprovider import provider
from rally import exceptions from rally import exceptions
from rally import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -20,9 +20,9 @@ import novaclient.exceptions
from rally.benchmark import utils as benchmark_utils from rally.benchmark import utils as benchmark_utils
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.deploy.serverprovider import provider from rally.deploy.serverprovider import provider
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import objects from rally import objects
from rally import osclients from rally import osclients

View File

@ -19,7 +19,7 @@ import sys
from oslo.config import cfg from oslo.config import cfg
from rally.common.i18n import _ from rally.common.i18n import _
from rally import log as logging from rally.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -30,9 +30,9 @@ from saharaclient import client as sahara
from troveclient import client as trove from troveclient import client as trove
from zaqarclient.queues import client as zaqar from zaqarclient.queues import client as zaqar
from rally.common import log as logging
from rally import consts from rally import consts
from rally import exceptions from rally import exceptions
from rally import log as logging
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -24,9 +24,9 @@ from six.moves import configparser
from six.moves.urllib import parse from six.moves.urllib import parse
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally import db from rally import db
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally import objects from rally import objects
from rally import osclients from rally import osclients

View File

@ -22,9 +22,9 @@ import sys
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from rally.common.i18n import _ from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils from rally.common import utils
from rally import exceptions from rally import exceptions
from rally import log as logging
from rally.verification.tempest import config from rally.verification.tempest import config
from rally.verification.tempest import subunit2json from rally.verification.tempest import subunit2json

View File

@ -12,7 +12,7 @@ Rally Specific Commandments
* [N302] - Ensure that nonexistent "assert_called" is not used * [N302] - Ensure that nonexistent "assert_called" is not used
* [N303] - Ensure that nonexistent "assert_called_once" is not used * [N303] - Ensure that nonexistent "assert_called_once" is not used
* [N310-N314] - Reserved for rules related to logging * [N310-N314] - Reserved for rules related to logging
* [N310] - Ensure that ``rally.log`` is used instead of ``rally.openstack.common.log`` * [N310] - Ensure that ``rally.common.log`` is used instead of ``rally.openstack.common.log``
* [N311] - Validate that debug level logs are not translated * [N311] - Validate that debug level logs are not translated
* [N312] - Validate correctness of debug on check. * [N312] - Validate correctness of debug on check.
* [N32x] - Reserved for rules related to assert* methods * [N32x] - Reserved for rules related to assert* methods

View File

@ -116,7 +116,7 @@ def check_import_of_logging(logical_line, filename):
N310 N310
""" """
excluded_files = ["./rally/log.py", "./tests/unit/test_log.py"] excluded_files = ["./rally/common/log.py", "./tests/unit/test_log.py"]
forbidden_imports = ["from rally.openstack.common import log", forbidden_imports = ["from rally.openstack.common import log",
"import rally.openstack.common.log", "import rally.openstack.common.log",
@ -126,7 +126,7 @@ def check_import_of_logging(logical_line, filename):
for forbidden_import in forbidden_imports: for forbidden_import in forbidden_imports:
if logical_line.startswith(forbidden_import): if logical_line.startswith(forbidden_import):
yield (0, "N310 Wrong module for logging is imported. Please " yield (0, "N310 Wrong module for logging is imported. Please "
"use `rally.log` instead.") "use `rally.common.log` instead.")
def no_translate_debug_logs(logical_line): def no_translate_debug_logs(logical_line):
@ -156,12 +156,13 @@ def no_use_conf_debug_check(logical_line, filename):
N312 N312
""" """
excluded_files = ["./rally/log.py"] excluded_files = ["./rally/common/log.py"]
point = logical_line.find("CONF.debug") point = logical_line.find("CONF.debug")
if point != -1 and filename not in excluded_files: if point != -1 and filename not in excluded_files:
yield(point, "N312 Don't use `CONF.debug`. " yield(point, "N312 Don't use `CONF.debug`. "
"Function `rally.log.is_debug` should be used instead.") "Function `rally.common.log.is_debug` "
"should be used instead.")
def assert_true_instance(logical_line): def assert_true_instance(logical_line):

View File

@ -65,9 +65,9 @@ class HackingTestCase(test.TestCase):
bad_imports = ["from rally.openstack.common import log", bad_imports = ["from rally.openstack.common import log",
"import rally.openstack.common.log", "import rally.openstack.common.log",
"import logging"] "import logging"]
good_imports = ["from rally import log", good_imports = ["from rally.common import log",
"from rally.log", "from rally.common.log",
"import rally.log"] "import rally.common.log"]
for bad_import in bad_imports: for bad_import in bad_imports:
checkres = checks.check_import_of_logging(bad_import, "fakefile") checkres = checks.check_import_of_logging(bad_import, "fakefile")
@ -75,7 +75,7 @@ class HackingTestCase(test.TestCase):
for bad_import in bad_imports: for bad_import in bad_imports:
checkres = checks.check_import_of_logging(bad_import, checkres = checks.check_import_of_logging(bad_import,
"./rally/log.py") "./rally/common/log.py")
self.assertEqual([], list(checkres)) self.assertEqual([], list(checkres))
for good_import in good_imports: for good_import in good_imports:

View File

@ -17,14 +17,14 @@ import logging
import mock import mock
from rally import log from rally.common import log
from tests.unit import test from tests.unit import test
class LogTestCase(test.TestCase): class LogTestCase(test.TestCase):
@mock.patch("rally.log.CONF") @mock.patch("rally.common.log.CONF")
@mock.patch("rally.log.oslogging") @mock.patch("rally.common.log.oslogging")
def test_setup(self, mock_oslogger, mock_conf): def test_setup(self, mock_oslogger, mock_conf):
proj = "fakep" proj = "fakep"
@ -44,9 +44,9 @@ class LogTestCase(test.TestCase):
mock_oslogger.getLogger(None).logger.setLevel.assert_called_once_with( mock_oslogger.getLogger(None).logger.setLevel.assert_called_once_with(
logging.RDEBUG) logging.RDEBUG)
@mock.patch("rally.log.logging") @mock.patch("rally.common.log.logging")
@mock.patch("rally.log.RallyContextAdapter") @mock.patch("rally.common.log.RallyContextAdapter")
@mock.patch("rally.log.oslogging") @mock.patch("rally.common.log.oslogging")
def test_getLogger(self, mock_oslogger, mock_radapter, mock_pylogging): def test_getLogger(self, mock_oslogger, mock_radapter, mock_pylogging):
proj = "fake" proj = "fake"
@ -63,8 +63,8 @@ class LogTestCase(test.TestCase):
class LogRallyContaxtAdapter(test.TestCase): class LogRallyContaxtAdapter(test.TestCase):
@mock.patch("rally.log.logging") @mock.patch("rally.common.log.logging")
@mock.patch("rally.log.oslogging.ContextAdapter") @mock.patch("rally.common.log.oslogging.ContextAdapter")
def test_debug(self, mock_oslo_adapter, mock_logging): def test_debug(self, mock_oslo_adapter, mock_logging):
mock_logging.RDEBUG = 123 mock_logging.RDEBUG = 123