Skip to content

Commit

Permalink
Migrate to oslo.log
Browse files Browse the repository at this point in the history
It's mostly a matter of changing imports to a new location.

Non-obvious changes needed:
* pass overwrite= argument to oslo_context since oslo.log reads context
  from its thread local store and not local.store from incubator
* don't store context at local.store now that there is no code that
  would consume it
* LOG.deprecated() -> versionutils.report_deprecated_feature()
* dropped LOG.audit check from hacking rule since now the method does
  not exist
* WritableLogger is now located in oslo_log.loggers

Dropped log module from the tree. Also dropped local module that is now
of no use (and obsolete, as per oslo team).

Added versionutils back to openstack-common.conf since now we use the
module directly from neutron code and not just as a dependency of some
other oslo-incubator module.

Note: tempest tests are expected to be broken now, so instead of fixing
all the oslo.log related issues for the subtree in this patch, I only
added TODOs with directions for later fix.

Closes-Bug: #1425013
Change-Id: I310e059a815377579de6bb2aa204de168e72571e
  • Loading branch information
booxter committed Mar 12, 2015
1 parent e3df45d commit 22328ba
Show file tree
Hide file tree
Showing 211 changed files with 297 additions and 1,029 deletions.
2 changes: 1 addition & 1 deletion neutron/agent/common/config.py
Expand Up @@ -16,9 +16,9 @@
import os

from oslo_config import cfg
from oslo_log import log as logging

from neutron.common import config
from neutron.openstack.common import log as logging


LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/dhcp/agent.py
Expand Up @@ -19,6 +19,7 @@
import eventlet

from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
from oslo_utils import importutils

Expand All @@ -34,7 +35,6 @@
from neutron import context
from neutron.i18n import _LE, _LI, _LW
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/l2population_rpc.py
Expand Up @@ -16,11 +16,11 @@
import abc

from oslo_config import cfg
from oslo_log import log as logging
import six

from neutron.common import constants as n_const
from neutron.common import log
from neutron.openstack.common import log as logging
from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/l3/agent.py
Expand Up @@ -16,6 +16,7 @@
import eventlet
import netaddr
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
from oslo_utils import excutils
from oslo_utils import importutils
Expand Down Expand Up @@ -45,7 +46,6 @@
from neutron import context as n_context
from neutron.i18n import _LE, _LI, _LW
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.openstack.common import periodic_task
from neutron.services import advanced_service as adv_svc
Expand Down
5 changes: 3 additions & 2 deletions neutron/agent/l3/dvr.py
Expand Up @@ -13,16 +13,17 @@
# under the License.

import binascii
import netaddr
import weakref

import netaddr
from oslo_log import log as logging

from neutron.agent.l3 import dvr_fip_ns
from neutron.agent.l3 import dvr_snat_ns
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from neutron.common import constants as l3_constants
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
5 changes: 3 additions & 2 deletions neutron/agent/l3/dvr_fip_ns.py
Expand Up @@ -12,15 +12,16 @@
# License for the specific language governing permissions and limitations
# under the License.

import netaddr
import os

import netaddr
from oslo_log import log as logging

from neutron.agent.l3 import link_local_allocator as lla
from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from neutron.common import utils as common_utils
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/l3/dvr_router.py
Expand Up @@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.

from oslo_log import log as logging
from oslo_utils import excutils

from neutron.agent.l3 import dvr_fip_ns
Expand All @@ -21,7 +22,6 @@
from neutron.common import constants as l3_constants
from neutron.common import utils as common_utils
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion neutron/agent/l3/dvr_snat_ns.py
Expand Up @@ -10,9 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.

from oslo_log import log as logging

from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)
SNAT_NS_PREFIX = 'snat-'
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/l3/ha.py
Expand Up @@ -16,11 +16,11 @@
import os

from oslo_config import cfg
from oslo_log import log as logging

from neutron.agent.linux import keepalived
from neutron.common import constants as l3_constants
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
5 changes: 3 additions & 2 deletions neutron/agent/l3/ha_router.py
Expand Up @@ -12,17 +12,18 @@
# License for the specific language governing permissions and limitations
# under the License.

import netaddr
import shutil
import signal

import netaddr
from oslo_log import log as logging

from neutron.agent.l3 import router_info as router
from neutron.agent.linux import ip_lib
from neutron.agent.linux import keepalived
from neutron.agent.metadata import driver as metadata_driver
from neutron.common import constants as n_consts
from neutron.common import utils as common_utils
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)
HA_DEV_PREFIX = 'ha-'
Expand Down
3 changes: 2 additions & 1 deletion neutron/agent/l3/namespace_manager.py
Expand Up @@ -10,11 +10,12 @@
# License for the specific language governing permissions and limitations
# under the License.

from oslo_log import log as logging

from neutron.agent.l3 import dvr_snat_ns
from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion neutron/agent/l3/namespaces.py
Expand Up @@ -13,9 +13,10 @@
# under the License.
#

from oslo_log import log as logging

from neutron.agent.linux import ip_lib
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion neutron/agent/l3/router_info.py
Expand Up @@ -12,14 +12,15 @@
# License for the specific language governing permissions and limitations
# under the License.

from oslo_log import log as logging

from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from neutron.common import constants as l3_constants
from neutron.common import exceptions as n_exc
from neutron.common import utils as common_utils
from neutron.i18n import _LW
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)
INTERNAL_DEV_PREFIX = 'qr-'
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/async_process.py
Expand Up @@ -15,11 +15,11 @@
import eventlet
import eventlet.event
import eventlet.queue
from oslo_log import log as logging

from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
from neutron.i18n import _LE
from neutron.openstack.common import log as logging


LOG = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion neutron/agent/linux/daemon.py
Expand Up @@ -20,9 +20,10 @@
import signal
import sys

from oslo_log import log as logging

from neutron.common import exceptions
from neutron.i18n import _LE, _LI
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/dhcp.py
Expand Up @@ -20,6 +20,7 @@
import shutil

import netaddr
from oslo_log import log as logging
from oslo_utils import importutils
import six

Expand All @@ -31,7 +32,6 @@
from neutron.common import ipv6_utils
from neutron.common import utils as commonutils
from neutron.i18n import _LE, _LI, _LW
from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/external_process.py
Expand Up @@ -20,13 +20,13 @@
import eventlet
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging

from neutron.agent.common import config as agent_cfg
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
from neutron.i18n import _LE
from neutron.openstack.common import fileutils
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/interface.py
Expand Up @@ -17,6 +17,7 @@

import netaddr
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
import six

Expand All @@ -27,7 +28,6 @@
from neutron.common import exceptions
from neutron.extensions import flavor
from neutron.i18n import _LE, _LI
from neutron.openstack.common import log as logging


LOG = logging.getLogger(__name__)
Expand Down
3 changes: 1 addition & 2 deletions neutron/agent/linux/ip_lib.py
Expand Up @@ -14,14 +14,13 @@
# under the License.

import eventlet

import netaddr
from oslo_config import cfg
from oslo_log import log as logging

from neutron.agent.linux import utils
from neutron.common import exceptions
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
3 changes: 2 additions & 1 deletion neutron/agent/linux/ip_link_support.py
Expand Up @@ -15,10 +15,11 @@

import re

from oslo_log import log as logging

from neutron.agent.linux import utils
from neutron.common import exceptions as n_exc
from neutron.i18n import _LE
from neutron.openstack.common import log as logging


LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/ip_monitor.py
Expand Up @@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.

from oslo_log import log as logging
from oslo_utils import excutils

from neutron.agent.linux import async_process
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/iptables_firewall.py
Expand Up @@ -15,6 +15,7 @@

import netaddr
from oslo_config import cfg
from oslo_log import log as logging

from neutron.agent import firewall
from neutron.agent.linux import ipset_manager
Expand All @@ -23,7 +24,6 @@
from neutron.common import constants
from neutron.common import ipv6_utils
from neutron.i18n import _LI
from neutron.openstack.common import log as logging


LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/iptables_manager.py
Expand Up @@ -25,6 +25,7 @@

from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils

from neutron.agent.common import config
Expand All @@ -33,7 +34,6 @@
from neutron.common import exceptions as n_exc
from neutron.common import utils
from neutron.i18n import _LE, _LW
from neutron.openstack.common import log as logging

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/keepalived.py
Expand Up @@ -19,11 +19,11 @@

import netaddr
from oslo_config import cfg
from oslo_log import log as logging

from neutron.agent.linux import external_process
from neutron.agent.linux import utils
from neutron.common import exceptions
from neutron.openstack.common import log as logging

VALID_STATES = ['MASTER', 'BACKUP']
VALID_NOTIFY_STATES = ['master', 'backup', 'fault']
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/ovs_lib.py
Expand Up @@ -18,6 +18,7 @@
import operator

from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import retrying
import six
Expand All @@ -27,7 +28,6 @@
from neutron.agent.ovsdb import api as ovsdb
from neutron.common import exceptions
from neutron.i18n import _LE, _LI, _LW
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants

# Default timeout for ovs-vsctl command
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/linux/ovsdb_monitor.py
Expand Up @@ -13,10 +13,10 @@
# under the License.

import eventlet
from oslo_log import log as logging

from neutron.agent.linux import async_process
from neutron.i18n import _LE
from neutron.openstack.common import log as logging


LOG = logging.getLogger(__name__)
Expand Down

0 comments on commit 22328ba

Please sign in to comment.