]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Migrate to oslo.log
authorIhar Hrachyshka <ihrachys@redhat.com>
Thu, 26 Feb 2015 22:26:41 +0000 (23:26 +0100)
committerIhar Hrachyshka <ihrachys@redhat.com>
Thu, 12 Mar 2015 10:22:56 +0000 (11:22 +0100)
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

211 files changed:
neutron/agent/common/config.py
neutron/agent/dhcp/agent.py
neutron/agent/l2population_rpc.py
neutron/agent/l3/agent.py
neutron/agent/l3/dvr.py
neutron/agent/l3/dvr_fip_ns.py
neutron/agent/l3/dvr_router.py
neutron/agent/l3/dvr_snat_ns.py
neutron/agent/l3/ha.py
neutron/agent/l3/ha_router.py
neutron/agent/l3/namespace_manager.py
neutron/agent/l3/namespaces.py
neutron/agent/l3/router_info.py
neutron/agent/linux/async_process.py
neutron/agent/linux/daemon.py
neutron/agent/linux/dhcp.py
neutron/agent/linux/external_process.py
neutron/agent/linux/interface.py
neutron/agent/linux/ip_lib.py
neutron/agent/linux/ip_link_support.py
neutron/agent/linux/ip_monitor.py
neutron/agent/linux/iptables_firewall.py
neutron/agent/linux/iptables_manager.py
neutron/agent/linux/keepalived.py
neutron/agent/linux/ovs_lib.py
neutron/agent/linux/ovsdb_monitor.py
neutron/agent/linux/ra.py
neutron/agent/linux/utils.py
neutron/agent/metadata/agent.py
neutron/agent/metadata/driver.py
neutron/agent/metadata/namespace_proxy.py
neutron/agent/metadata_agent.py
neutron/agent/ovsdb/impl_vsctl.py
neutron/agent/rpc.py
neutron/agent/securitygroups_rpc.py
neutron/api/api_common.py
neutron/api/extensions.py
neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py
neutron/api/rpc/agentnotifiers/metering_rpc_agent_api.py
neutron/api/rpc/handlers/dhcp_rpc.py
neutron/api/rpc/handlers/dvr_rpc.py
neutron/api/rpc/handlers/l3_rpc.py
neutron/api/v2/attributes.py
neutron/api/v2/base.py
neutron/api/v2/resource.py
neutron/api/v2/router.py
neutron/api/versions.py
neutron/auth.py
neutron/callbacks/manager.py
neutron/cmd/netns_cleanup.py
neutron/cmd/ovs_cleanup.py
neutron/cmd/sanity/checks.py
neutron/cmd/sanity_check.py
neutron/common/config.py
neutron/common/ipv6_utils.py
neutron/common/log.py
neutron/common/repos.py
neutron/common/rpc.py
neutron/common/utils.py
neutron/context.py
neutron/db/agents_db.py
neutron/db/agentschedulers_db.py
neutron/db/db_base_plugin_v2.py
neutron/db/dvr_mac_db.py
neutron/db/extradhcpopt_db.py
neutron/db/extraroute_db.py
neutron/db/l3_agentschedulers_db.py
neutron/db/l3_db.py
neutron/db/l3_dvr_db.py
neutron/db/l3_dvrscheduler_db.py
neutron/db/l3_gwmode_db.py
neutron/db/l3_hamode_db.py
neutron/db/metering/metering_db.py
neutron/db/metering/metering_rpc.py
neutron/db/portsecurity_db.py
neutron/db/securitygroups_db.py
neutron/db/securitygroups_rpc_base.py
neutron/db/servicetype_db.py
neutron/db/sqlalchemyutils.py
neutron/debug/commands.py
neutron/debug/debug_agent.py
neutron/extensions/flavor.py
neutron/extensions/l3agentscheduler.py
neutron/extensions/metering.py
neutron/extensions/servicetype.py
neutron/hacking/checks.py
neutron/manager.py
neutron/notifiers/nova.py
neutron/openstack/common/local.py [deleted file]
neutron/openstack/common/log.py [deleted file]
neutron/plugins/brocade/NeutronPlugin.py
neutron/plugins/brocade/nos/nosdriver.py
neutron/plugins/brocade/tests/noscli.py
neutron/plugins/cisco/db/n1kv_db_v2.py
neutron/plugins/cisco/db/n1kv_models_v2.py
neutron/plugins/cisco/db/network_db_v2.py
neutron/plugins/cisco/models/virt_phy_sw_v2.py
neutron/plugins/cisco/n1kv/n1kv_client.py
neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py
neutron/plugins/cisco/network_plugin.py
neutron/plugins/embrane/agent/dispatcher.py
neutron/plugins/embrane/agent/operations/router_operations.py
neutron/plugins/embrane/base_plugin.py
neutron/plugins/embrane/common/utils.py
neutron/plugins/hyperv/agent/hyperv_neutron_agent.py
neutron/plugins/hyperv/agent/security_groups_driver.py
neutron/plugins/hyperv/agent/utils.py
neutron/plugins/hyperv/agent/utilsfactory.py
neutron/plugins/ibm/agent/sdnve_neutron_agent.py
neutron/plugins/ibm/sdnve_api.py
neutron/plugins/ibm/sdnve_api_fake.py
neutron/plugins/ibm/sdnve_neutron_plugin.py
neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/plugins/ml2/db.py
neutron/plugins/ml2/driver_context.py
neutron/plugins/ml2/drivers/arista/mechanism_arista.py
neutron/plugins/ml2/drivers/brocade/mechanism_brocade.py
neutron/plugins/ml2/drivers/brocade/nos/nosdriver.py
neutron/plugins/ml2/drivers/cisco/apic/apic_sync.py
neutron/plugins/ml2/drivers/cisco/apic/apic_topology.py
neutron/plugins/ml2/drivers/cisco/apic/mechanism_apic.py
neutron/plugins/ml2/drivers/cisco/ncs/driver.py
neutron/plugins/ml2/drivers/freescale/mechanism_fslsdn.py
neutron/plugins/ml2/drivers/helpers.py
neutron/plugins/ml2/drivers/l2pop/mech_driver.py
neutron/plugins/ml2/drivers/l2pop/rpc.py
neutron/plugins/ml2/drivers/mech_agent.py
neutron/plugins/ml2/drivers/mech_hyperv.py
neutron/plugins/ml2/drivers/mech_linuxbridge.py
neutron/plugins/ml2/drivers/mech_nuage/driver.py
neutron/plugins/ml2/drivers/mech_openvswitch.py
neutron/plugins/ml2/drivers/mech_sriov/mech_driver.py
neutron/plugins/ml2/drivers/mlnx/mech_mlnx.py
neutron/plugins/ml2/drivers/opendaylight/driver.py
neutron/plugins/ml2/drivers/type_flat.py
neutron/plugins/ml2/drivers/type_gre.py
neutron/plugins/ml2/drivers/type_local.py
neutron/plugins/ml2/drivers/type_tunnel.py
neutron/plugins/ml2/drivers/type_vlan.py
neutron/plugins/ml2/drivers/type_vxlan.py
neutron/plugins/ml2/managers.py
neutron/plugins/ml2/plugin.py
neutron/plugins/ml2/rpc.py
neutron/plugins/mlnx/agent/eswitch_neutron_agent.py
neutron/plugins/nec/extensions/router_provider.py
neutron/plugins/oneconvergence/agent/nvsd_neutron_agent.py
neutron/plugins/oneconvergence/lib/nvsdlib.py
neutron/plugins/oneconvergence/lib/plugin_helper.py
neutron/plugins/oneconvergence/plugin.py
neutron/plugins/opencontrail/contrail_plugin.py
neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/plugins/sriovnicagent/eswitch_manager.py
neutron/plugins/sriovnicagent/pci_lib.py
neutron/plugins/sriovnicagent/sriov_nic_agent.py
neutron/policy.py
neutron/quota.py
neutron/scheduler/dhcp_agent_scheduler.py
neutron/scheduler/l3_agent_scheduler.py
neutron/server/__init__.py
neutron/service.py
neutron/services/advanced_service.py
neutron/services/firewall/agents/firewall_agent_api.py
neutron/services/firewall/agents/l3reference/firewall_l3_agent.py
neutron/services/l3_router/brocade/l3_router_plugin.py
neutron/services/l3_router/l3_arista.py
neutron/services/metering/agents/metering_agent.py
neutron/services/metering/drivers/iptables/iptables_driver.py
neutron/services/provider_configuration.py
neutron/services/service_base.py
neutron/tests/api/contrib/clients.py
neutron/tests/functional/agent/linux/test_ip_lib.py
neutron/tests/functional/agent/test_l3_agent.py
neutron/tests/tempest/api/network/base.py
neutron/tests/tempest/api/network/test_metering_extensions.py
neutron/tests/tempest/auth.py
neutron/tests/tempest/common/accounts.py
neutron/tests/tempest/common/commands.py
neutron/tests/tempest/common/cred_provider.py
neutron/tests/tempest/common/generator/base_generator.py
neutron/tests/tempest/common/generator/negative_generator.py
neutron/tests/tempest/common/generator/valid_generator.py
neutron/tests/tempest/common/glance_http.py
neutron/tests/tempest/common/isolated_creds.py
neutron/tests/tempest/common/ssh.py
neutron/tests/tempest/common/utils/misc.py
neutron/tests/tempest/common/waiters.py
neutron/tests/tempest/config.py
neutron/tests/tempest/test.py
neutron/tests/unit/database_stubs.py
neutron/tests/unit/hacking/test_checks.py
neutron/tests/unit/ml2/drivers/brocade/test_brocade_l3_plugin.py
neutron/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py
neutron/tests/unit/ml2/drivers/mech_fake_agent.py
neutron/tests/unit/ml2/drivers/mechanism_logger.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_tunnel.py
neutron/tests/unit/test_agent_ext_plugin.py
neutron/tests/unit/test_extension_ext_net.py
neutron/tests/unit/test_extension_extradhcpopts.py
neutron/tests/unit/test_extension_extraroute.py
neutron/tests/unit/test_extensions.py
neutron/tests/unit/test_l3_agent.py
neutron/tests/unit/test_l3_plugin.py
neutron/tests/unit/test_linux_dhcp.py
neutron/tests/unit/test_neutron_context.py
neutron/tests/unit/test_neutron_manager.py
neutron/tests/unit/test_wsgi.py
neutron/wsgi.py
openstack-common.conf

index d559612b5a4b0fbf5904b47a78b94fb30ac83b91..4862cffe9c04e9cb676ffa58cdda8929c2f411bc 100644 (file)
@@ -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__)
index 8f0647c8992f817001d24d03aaaad849cb0331e6..0d6624d023738de82f0c069d47267ea59bc4c88b 100644 (file)
@@ -19,6 +19,7 @@ import os
 import eventlet
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import importutils
 
@@ -34,7 +35,6 @@ from neutron.common import utils
 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__)
index 6547a29a06492803cc400937a1edea11554af323..50ba665b082c5faed4c89ae59d0e8c6da1bc50ab 100644 (file)
 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__)
index e793d9d1aff392a7bd98a855060d30ff6ed82ee9..0e4a6ce3ba09cbae5544c04c9baa163ec874c310 100644 (file)
@@ -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
@@ -45,7 +46,6 @@ from neutron.common import utils as common_utils
 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
index ed4bc28a2e99e20bca0176ddeb241357c5ed916d..0c6424c2edc6ef3880519a74308b945fc16022f9 100644 (file)
 #    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__)
 
index 5369fc8b322a845db022f822ef662176faa16567..d7d11ddcf16dc02738de8a709945fd3b0e4491ba 100644 (file)
 #    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__)
 
index 5dc290232c235bfa83f5ec15eef65ae70ebf131d..713cce4349a0274c95ebf44f879f9e2be31b3fbc 100644 (file)
@@ -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
@@ -21,7 +22,6 @@ from neutron.agent.linux import ip_lib
 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__)
 
index 2ab940bc14c4eb504fca494ae02d0b32dd0638b5..194f2a8c2362444d44b8421103f555eac0e511e8 100644 (file)
 #    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-'
index 5758abba09a1065750d34ee44efaae5cc9446a84..86b7169f328db50b0a5eaab643e92c6e204829be 100644 (file)
 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__)
 
index 67e8aee5bfc385215da2dd6b451a1e7272e2e847..83a25ee671a87468b2a676b7fcd5ce0376fc6f51 100644 (file)
 #    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-'
index 21f72cb0aaab188092811971f6ef58958720e193..52333f0c248b61cce776c1297eb83b49453ad220 100644 (file)
 #    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__)
 
index 27111ac0647c8eaa89d2fdff13ae0595e06e92bd..e1c6813d31176d516ace2a4bcf637e7d5c3fbde2 100644 (file)
 #    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__)
 
index 3c01112bab79dc855000064ce5b9ad3d09fb7d38..ab44bf44933361bf466f4b485f73efe88e9faf2d 100644 (file)
@@ -12,6 +12,8 @@
 #    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
@@ -19,7 +21,6 @@ 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-'
index 8da4ae2c30f280fc4a9bc0fbe389a068aafe6fa4..ddb7681279aa842d59c681f88e3a4a914cd74ca8 100644 (file)
 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__)
index 42ace422a04e37824498e94e8d02ee5ca09f8b01..65ea4af8649b7c94464b1b016a94837cdb3547ee 100644 (file)
@@ -20,9 +20,10 @@ import pwd
 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__)
 
index 08e3c84b46d4344bd5af8b28e9d6b7e0338d39bd..1b0e0e64dd45cb5e7c0249110f453f65f4eb80aa 100644 (file)
@@ -20,6 +20,7 @@ import re
 import shutil
 
 import netaddr
+from oslo_log import log as logging
 from oslo_utils import importutils
 import six
 
@@ -31,7 +32,6 @@ from neutron.common import exceptions
 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__)
index abed5ba42d477dbfe0b3fffef4f2d44878658bd1..95beddd99df52401451ce20eceb53edc15984515 100644 (file)
@@ -20,13 +20,13 @@ import six
 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__)
 
index 3fe78f81ab32e14006feb503da6570a67b3ec6fa..d3eb2f10c8f1a85aaeaa7d0190f92128f720f617 100644 (file)
@@ -17,6 +17,7 @@ import abc
 
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 import six
 
@@ -27,7 +28,6 @@ from neutron.common import constants as n_const
 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__)
index 733703e0eb8129c32afb08096ea1ef1d34371bca..e37d6a536a5003e3d3ed63ab1b9001c1bb44233c 100644 (file)
 #    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__)
 
index 2a1083bc0509fbf33e8130b65d8c9cec44c32710..d41a2ecb8d07ce03675d247f1bcf7b9beaa07817 100644 (file)
 
 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__)
index f7485c2ec4b48a5b3553823d3da798c7ed5a5847..02bb242cbbf6f661cc7fc0599d57454a2dab1e37 100644 (file)
 #    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__)
 
index 4830bc213598b55a13f0a68cd5eb6344d01e7f39..8ad2db0a7b47a0562aeb25f96c7607fefb21ef5c 100644 (file)
@@ -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
@@ -23,7 +24,6 @@ from neutron.agent.linux import iptables_manager
 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__)
index 5adf1d227cec00af53c8bd62ffe8f229bd0a8c73..065c1823e3cfc606d3f2e87d7c90dec6d9ebaa70 100644 (file)
@@ -25,6 +25,7 @@ import sys
 
 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
@@ -33,7 +34,6 @@ from neutron.agent.linux import utils as linux_utils
 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__)
 
index c448f41ae3599cba88e98e05ba3bacd3e2595d8e..8164af0b094d7654b29697afa8832ff865affcdc 100644 (file)
@@ -19,11 +19,11 @@ import stat
 
 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']
index 5eb3d025250735267de4d3512ecea617131240c4..531232388f0104d58b28b21423c1772f0ba6c325 100644 (file)
@@ -18,6 +18,7 @@ import itertools
 import operator
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import excutils
 import retrying
 import six
@@ -27,7 +28,6 @@ from neutron.agent.linux import utils
 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
index 4c1863c36cb49b627e51c640949a2c4c63d7a9ac..02f45f6b1b93c3cb5ae26c5c8e7703045e13d1f6 100644 (file)
 #    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__)
index ef8346e4588afd90cf97e425b0750af8a77554b1..e017116d88fbcc7c5799d8d6050876746beb4060 100644 (file)
 import jinja2
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 import six
 
 from neutron.agent.linux import external_process
 from neutron.agent.linux import utils
 from neutron.common import constants
-from neutron.openstack.common import log as logging
 
 
 RADVD_SERVICE_NAME = 'radvd'
index 447208538134d93b1e9fd3ea90faf66b2077d986..6bf4bea09f10db671e83f560dc5dad1c232a8f1f 100644 (file)
@@ -25,13 +25,13 @@ import eventlet
 from eventlet.green import subprocess
 from eventlet import greenthread
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import excutils
 
 from neutron.agent.common import config
 from neutron.common import constants
 from neutron.common import utils
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 21ecea3e842d10b80ad860e8f8b3b75c585587cd..22ed9f3fe2f3f618f55d85b385f5e3342c9813b6 100644 (file)
@@ -21,6 +21,8 @@ import eventlet
 import httplib2
 from neutronclient.v2_0 import client
 from oslo_config import cfg
+from oslo_log import log as logging
+from oslo_log import loggers
 import oslo_messaging
 from oslo_utils import excutils
 import six.moves.urllib.parse as urlparse
@@ -34,7 +36,6 @@ from neutron.common import utils
 from neutron import context
 from neutron.i18n import _LE, _LW
 from neutron.openstack.common.cache import cache
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 from neutron import wsgi
 
@@ -294,7 +295,7 @@ class UnixDomainWSGIServer(wsgi.Server):
                              application,
                              max_size=self.num_threads,
                              protocol=UnixDomainHttpProtocol,
-                             log=logging.WritableLogger(logger))
+                             log=loggers.WritableLogger(logger))
 
 
 class UnixDomainMetadataProxy(object):
index f7808d4a2c0933e45a0b84f905ee155ce3431a16..1e36460eedabb0eba20fe29edec1dda238bb9921 100644 (file)
 import os
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.agent.common import config
 from neutron.agent.linux import external_process
 from neutron.common import exceptions
-from neutron.openstack.common import log as logging
 from neutron.services import advanced_service
 
 LOG = logging.getLogger(__name__)
index 690453097b345a1322b1244344ddf295344b9a80..be1d32adf7086ef599345ae55ed2ce33beb18f40 100644 (file)
@@ -17,6 +17,7 @@ import socket
 
 import httplib2
 from oslo_config import cfg
+from oslo_log import log as logging
 import six.moves.urllib.parse as urlparse
 import webob
 
@@ -25,7 +26,6 @@ from neutron.common import config
 from neutron.common import exceptions
 from neutron.common import utils
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron import wsgi
 
 LOG = logging.getLogger(__name__)
index a6cec3a28ee106fef8a389491620318aacf792f5..11135aec95e7edf01a894fa2e91ef69f77f07dd2 100644 (file)
@@ -15,6 +15,7 @@
 import sys
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.agent.common import config as agent_conf
 from neutron.agent.metadata import agent
@@ -22,7 +23,6 @@ from neutron.agent.metadata import config as metadata_conf
 from neutron.common import config
 from neutron.common import utils
 from neutron.openstack.common.cache import cache
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 3ffca811c96eeb5a6b54e91fdcd5dbcf4136e994..57b74989366bdc818c374dd36d9363afd7047c26 100644 (file)
@@ -16,13 +16,13 @@ import collections
 import itertools
 import uuid
 
+from oslo_log import log as logging
 from oslo_serialization import jsonutils
 from oslo_utils import excutils
 
 from neutron.agent.linux import utils
 from neutron.agent.ovsdb import api as ovsdb
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 7f5677437251360f7255125784642b009651d5ec..f71d36032e8429f6c06ef136c6f50460f7f5346e 100644 (file)
@@ -14,6 +14,8 @@
 #    under the License.
 
 import itertools
+
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import timeutils
 
@@ -21,7 +23,6 @@ from neutron.common import constants
 from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 5fe11a236ccf1e88a750c4deb90f4f8ac1fe41d9..527c65d76e0b5acc7c96e547da93509fd33ae403 100644 (file)
@@ -17,6 +17,7 @@
 import functools
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import importutils
 
@@ -25,7 +26,6 @@ from neutron.common import constants
 from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.i18n import _LI, _LW
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 # history
index b34765e3449783ac4533f77cb71df9dbc6e20f0d..b97e3a3913038ea8ae8cf2471053cec2d405394f 100644 (file)
 import urllib
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from webob import exc
 
 from neutron.common import constants
 from neutron.common import exceptions
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index b47bc6149dde1ef809a934aa7f43ffad4b749390..aa4e2b9572da835863fe3ffad1e94b8aff0d6e0f 100644 (file)
@@ -21,6 +21,7 @@ import itertools
 import os
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import routes
 import six
 import webob.dec
@@ -31,7 +32,6 @@ from neutron.common import repos
 import neutron.extensions
 from neutron.i18n import _LE, _LI, _LW
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron import wsgi
 
 
index 3f2fbc0e2f6134a1851b4c5c61f3cd64b2effd0d..edba999747f3309ad7e65c20cf9159237490b411 100644 (file)
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.common import constants
@@ -21,7 +22,6 @@ from neutron.common import topics
 from neutron.common import utils
 from neutron.i18n import _LE, _LW
 from neutron import manager
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 07d95d65d33fd6cdcc539dde0c49fd0fbc271651..097e7f88bd71821052da87a748b4e19de43eadc3 100644 (file)
@@ -15,6 +15,7 @@
 
 import random
 
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.common import constants
@@ -23,7 +24,6 @@ from neutron.common import topics
 from neutron.common import utils
 from neutron.i18n import _LE
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as service_constants
 
 
index d3be6b1079c2d7766cdc7269a5aafef030503666..f7640cf8fa094d469004d766ca428d710895a265 100644 (file)
@@ -12,6 +12,7 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.common import constants
@@ -19,7 +20,6 @@ from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as service_constants
 
 LOG = logging.getLogger(__name__)
index bbe68f8955eed6634d09532d8a5b5a388750d559..4e17e39dda0f9d3f29c93e20d8b3d069496a64a3 100644 (file)
@@ -18,6 +18,7 @@ import operator
 
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import excutils
 
@@ -28,7 +29,6 @@ from neutron.common import utils
 from neutron.extensions import portbindings
 from neutron.i18n import _LW
 from neutron import manager
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index fb0e083b5159e7ce1148ac2c16047b1682424bce..bbfe6e02a4609dec3851c67b69510aac9402d293 100644 (file)
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.common import constants
@@ -20,7 +21,6 @@ from neutron.common import log
 from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import manager
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 2ae38c2aa1ae91c3c07582d0d7a83fea0feba191..0c979d377c61f2df18a1f4f953e353e032fab5bd 100644 (file)
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_serialization import jsonutils
 
@@ -25,7 +26,6 @@ from neutron.extensions import l3
 from neutron.extensions import portbindings
 from neutron.i18n import _LE
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as plugin_constants
 
 
index 7fb4a44097300e1c9ecc92c5bb296a7ceb51a663..34d55b03cb926602fa9c545a7b26cc5cf8b0656d 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import netaddr
 import re
 
+import netaddr
+from oslo_log import log as logging
+
 from neutron.common import constants
 from neutron.common import exceptions as n_exc
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 
 
index fdcc04de2fc8bb63b09e607ebe173b7ce8910a3d..e32c85f11eb41a3b23e69214adb18911a7ee0ba3 100644 (file)
 #    under the License.
 
 import copy
-import netaddr
-import webob.exc
 
+import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import excutils
+import webob.exc
 
 from neutron.api import api_common
 from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
@@ -28,7 +29,6 @@ from neutron.common import constants as const
 from neutron.common import exceptions
 from neutron.common import rpc as n_rpc
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import policy as common_policy
 from neutron import policy
 from neutron import quota
index 34bd428e77299e891515c2f8638ff0a772a82296..09919b93815156947800e4319336acdc5a081699 100644 (file)
@@ -21,13 +21,13 @@ import sys
 
 import netaddr
 import oslo_i18n
+from oslo_log import log as logging
 import six
 import webob.dec
 import webob.exc
 
 from neutron.common import exceptions
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import policy as common_policy
 from neutron import wsgi
 
index b1522f6096f001b8900990a42ec5f635a286ccbf..de0147db410b99aec8c98d1d09df57f0670cd45c 100644 (file)
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import routes as routes_mapper
 import six.moves.urllib.parse as urlparse
 import webob
@@ -24,7 +25,6 @@ from neutron.api import extensions
 from neutron.api.v2 import attributes
 from neutron.api.v2 import base
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron import policy
 from neutron import wsgi
 
index d9c1b4d0cbd076eb84ba20e05f62f01812262558..3d9cfec6c385a01e8be3cf529ff81b8b9596bb1a 100644 (file)
 #    under the License.
 
 import oslo_i18n
+from oslo_log import log as logging
 import webob.dec
 
 from neutron.api.views import versions as versions_view
-from neutron.openstack.common import log as logging
 from neutron import wsgi
 
 
index 09ce3d2ebcc22342a840f2d29a61870afd7f061f..b8c45e2e80414e085f4cce42c4237a90e0a20f00 100644 (file)
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_middleware import request_id
 import webob.dec
 import webob.exc
 
 from neutron import context
-from neutron.openstack.common import log as logging
 from neutron import wsgi
 
 LOG = logging.getLogger(__name__)
index eda43e052354c4225918d64951e7ac90170272e4..365a54f27f37e005992f46febcf03b9c96f2deb8 100644 (file)
 import collections
 import weakref
 
+from oslo_log import log as logging
 from oslo_utils import reflection
 
 from neutron.callbacks import events
 from neutron.callbacks import exceptions
 from neutron.callbacks import resources
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index e579693b9d338687a3706f6e6c04d819be414425..570ca71de55485fd33b34d66e873ffd3c989c874 100644 (file)
@@ -17,6 +17,7 @@ import re
 import time
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 
 from neutron.agent.common import config as agent_config
@@ -29,7 +30,6 @@ from neutron.agent.linux import ovs_lib
 from neutron.api.v2 import attributes
 from neutron.common import config
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index a5010466a820752c5056e6451406e14556bea2d2..180fae8ec6e83e0ae24c70dd96b95fb639b1d9b4 100644 (file)
@@ -14,6 +14,7 @@
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.agent.common import config as agent_config
 from neutron.agent.l3 import config as l3_config
@@ -22,7 +23,6 @@ from neutron.agent.linux import ip_lib
 from neutron.agent.linux import ovs_lib
 from neutron.common import config
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 210e22f5f02a65abbe2a631a339a78716c0c72ba..c0245bc17b51700612398027891f6d5e31a82103 100644 (file)
@@ -16,6 +16,7 @@
 import re
 
 import netaddr
+from oslo_log import log as logging
 
 from neutron.agent.linux import ip_lib
 from neutron.agent.linux import ip_link_support
@@ -23,7 +24,6 @@ from neutron.agent.linux import ovs_lib
 from neutron.agent.linux import utils as agent_utils
 from neutron.common import utils
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.plugins.common import constants as const
 from neutron.plugins.openvswitch.common import constants as ovs_const
index 92e61d57297e623d39d98eecb88df71d67051468..58531879a71efc05689ad165496e66b1db25ed5f 100644 (file)
 
 import sys
 
+from oslo_config import cfg
+from oslo_log import log as logging
+
 from neutron.agent import dhcp_agent
 from neutron.cmd.sanity import checks
 from neutron.common import config
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log as logging
-from oslo_config import cfg
 
 
 LOG = logging.getLogger(__name__)
index 696f1c4f913155a8c86f7dc52b36862e0d65937c..194f8f9492d9f3517fbeb8c98ebb03833bb09288 100644 (file)
@@ -24,13 +24,13 @@ from keystoneclient import auth
 from keystoneclient import session as ks_session
 from oslo_config import cfg
 from oslo_db import options as db_options
+from oslo_log import log as logging
 import oslo_messaging
 from paste import deploy
 
 from neutron.api.v2 import attributes
 from neutron.common import utils
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 from neutron import version
 
 
@@ -163,6 +163,8 @@ nova_opts = [
 ]
 cfg.CONF.register_opts(nova_opts, group=NOVA_CONF_SECTION)
 
+logging.register_options(cfg.CONF)
+
 
 def init(args, **kwargs):
     cfg.CONF(args=args, project='neutron',
@@ -185,7 +187,7 @@ def init(args, **kwargs):
 def setup_logging():
     """Sets up the logging options for a log with supplied name."""
     product_name = "neutron"
-    logging.setup(product_name)
+    logging.setup(cfg.CONF, product_name)
     LOG.info(_LI("Logging enabled!"))
     LOG.info(_LI("%(prog)s version %(version)s"),
              {'prog': sys.argv[0],
index e11a218ee4c20c4ce00444522f6d088f772e7ebc..ad531baf387f44131890bdba5ef5f3d5bb6e7654 100644 (file)
@@ -19,10 +19,10 @@ IPv6-related utilities and helper functions.
 import os
 
 import netaddr
+from oslo_log import log
 
 from neutron.common import constants
 from neutron.i18n import _LI
-from neutron.openstack.common import log
 
 
 LOG = log.getLogger(__name__)
index f1b5f425fd801f7b78e47f96d564cb1a26313182..b5fcaf15bb9a5336066b7b571e41c7e91a2e02cb 100644 (file)
@@ -15,7 +15,7 @@
 """Log helper functions."""
 import functools
 
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
 
 
 def log(method):
index e2a421e4c7a2384f0de0f57e756303f40596051c..59b8735b7f26f8daa92d1407dcbf9dc26c5a9f2c 100644 (file)
@@ -18,8 +18,7 @@ import importlib
 import os
 
 from oslo_config import cfg
-
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 0bdd6c38704353888a32665763b0318b19849c3c..732f0527f2a635dffd2b1f00200fcff92d7edf53 100644 (file)
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_messaging import serializer as om_serializer
 
 from neutron.common import exceptions
 from neutron import context
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import service
 
 
index bd75238cc9ba2ec3c0131ba02c65a88d1b35440d..9d6b6a1cce4b05533bdc0002edc4afdb364ab75a 100644 (file)
@@ -33,10 +33,10 @@ import uuid
 from eventlet.green import subprocess
 from oslo_concurrency import lockutils
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import excutils
 
 from neutron.common import constants as q_const
-from neutron.openstack.common import log as logging
 
 
 TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
index 4e3e4f2ef2abc708524214c62cb5f93d2e8b4598..1889b092dbe0077cc146980cd4d29d2d435f2c11 100644 (file)
@@ -19,10 +19,9 @@ import copy
 import datetime
 
 from oslo_context import context as oslo_context
+from oslo_log import log as logging
 
 from neutron.db import api as db_api
-from neutron.openstack.common import local
-from neutron.openstack.common import log as logging
 from neutron import policy
 
 
@@ -55,7 +54,8 @@ class ContextBase(oslo_context.RequestContext):
         super(ContextBase, self).__init__(auth_token=auth_token,
                                           user=user_id, tenant=tenant_id,
                                           is_admin=is_admin,
-                                          request_id=request_id)
+                                          request_id=request_id,
+                                          overwrite=overwrite)
         self.user_name = user_name
         self.tenant_name = tenant_name
 
@@ -73,10 +73,6 @@ class ContextBase(oslo_context.RequestContext):
             admin_roles = policy.get_admin_roles()
             if admin_roles:
                 self.roles = list(set(self.roles) | set(admin_roles))
-        # Allow openstack.common.log to access the context
-        if overwrite or not hasattr(local.store, 'context'):
-            local.store.context = self
-
         # Log only once the context has been configured to prevent
         # format errors.
         if kwargs:
index 6cae2084be171290413327db49b55a87382e7020..7596fef9d83ce4d08d7e532539042677ba1abef1 100644 (file)
@@ -14,9 +14,9 @@
 #    under the License.
 
 from eventlet import greenthread
-
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_serialization import jsonutils
 from oslo_utils import timeutils
@@ -31,7 +31,6 @@ from neutron.db import models_v2
 from neutron.extensions import agent as ext_agent
 from neutron.i18n import _LW
 from neutron import manager
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 cfg.CONF.register_opt(
index e330b0fc390322e74a7d9693f2c5144322087a5a..4257144ac66ed5de014881a0e3c1e1652c2a66a5 100644 (file)
@@ -18,6 +18,7 @@ import random
 import time
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import timeutils
 import sqlalchemy as sa
 from sqlalchemy import orm
@@ -32,7 +33,6 @@ from neutron.db import model_base
 from neutron.extensions import agent as ext_agent
 from neutron.extensions import dhcpagentscheduler
 from neutron.i18n import _LE, _LI, _LW
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 
 
index 50f3bd41014332d8ea443bdb062f98df6b2f6cbf..73db078b82a5bd9088c98b7007c60089542a48ed 100644 (file)
@@ -16,6 +16,7 @@
 import netaddr
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 from oslo_utils import excutils
 from sqlalchemy import and_
 from sqlalchemy import event
@@ -35,7 +36,6 @@ from neutron.extensions import l3
 from neutron.i18n import _LE, _LI
 from neutron import manager
 from neutron import neutron_plugin_base_v2
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.plugins.common import constants as service_constants
 
index f849c19f685756771c723f8b64b3ba49efb82b52..b432d8b84a3fb00c9530456fce72ec10a12a9825 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_config import cfg
 from oslo_db import exception as db_exc
-
+from oslo_log import log as logging
 import sqlalchemy as sa
+from sqlalchemy.orm import exc
 
 from neutron.common import exceptions as q_exc
 from neutron.common import log
@@ -25,12 +27,11 @@ from neutron.extensions import dvr as ext_dvr
 from neutron.extensions import portbindings
 from neutron.i18n import _LE
 from neutron import manager
-from neutron.openstack.common import log as logging
-from oslo_config import cfg
-from sqlalchemy.orm import exc
+
 
 LOG = logging.getLogger(__name__)
 
+
 dvr_mac_address_opts = [
     cfg.StrOpt('dvr_base_mac',
                default="fa:16:3f:00:00:00",
index fc58027c3d52eaf578020637f2d238869033102c..09d64c70d09cfb361961c942364c2c81e455a88f 100644 (file)
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import orm
 
@@ -21,7 +22,7 @@ from neutron.db import db_base_plugin_v2
 from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.extensions import extra_dhcp_opt as edo_ext
-from neutron.openstack.common import log as logging
+
 
 LOG = logging.getLogger(__name__)
 
index 59027dc2199037f4b1587c8f8d39a28fca0929d7..5966439c96e5e5f2868ddc9880e2bb02764b2909 100644 (file)
@@ -15,6 +15,7 @@
 
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import orm
 
@@ -25,7 +26,6 @@ from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.extensions import extraroute
 from neutron.extensions import l3
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index c0142b22b98965d3948996806f2d342fcd666025..cb8206b74ceb3678455045fab523e20a4a599d89 100644 (file)
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
+
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 import oslo_messaging
 import sqlalchemy as sa
 from sqlalchemy import func
@@ -32,7 +34,6 @@ from neutron.db import model_base
 from neutron.extensions import l3agentscheduler
 from neutron.i18n import _LE, _LI, _LW
 from neutron import manager
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index f3aa036b4be3ff5aa08235baf753999188067970..0ebefc83de9ad200b99d966b9fe312a249452fe5 100644 (file)
@@ -13,6 +13,7 @@
 #    under the License.
 
 import netaddr
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import orm
 from sqlalchemy.orm import exc
@@ -35,7 +36,6 @@ from neutron.extensions import external_net
 from neutron.extensions import l3
 from neutron.i18n import _LI
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.plugins.common import constants
 
index f507412dedffc320c4feead56c83576aecf4998b..f630cae534648f3abe314868664fa35266306199 100644 (file)
@@ -13,6 +13,7 @@
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.api.v2 import attributes
 from neutron.common import constants as l3_const
@@ -26,7 +27,6 @@ from neutron.extensions import l3
 from neutron.extensions import portbindings
 from neutron.i18n import _LI
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 
 
index 2d3eb4360c57695df328a60639e0d54e580f0190..e367381be5326b46193760139906b13002fd28d5 100644 (file)
@@ -16,6 +16,7 @@
 import random
 
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import orm
 from sqlalchemy.orm import exc
@@ -28,7 +29,6 @@ from neutron.db import l3_agentschedulers_db as l3agent_sch_db
 from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.i18n import _LI, _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.ml2 import db as ml2_db
 
 LOG = logging.getLogger(__name__)
index e9f081f6fce4700a7ab09f8e2f20e93124babd70..6d4b3306180ff16c0842a73143dd2e2a4498e943 100644 (file)
 #    under the License.
 #
 
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import sql
 
 from neutron.db import db_base_plugin_v2
 from neutron.db import l3_db
 from neutron.extensions import l3
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index ce30fcb98a6c0007e7400665a3097a6b4d46335c..6b978cedb168d92d8c3feab3027761bfa2798de7 100644 (file)
@@ -16,6 +16,7 @@
 import netaddr
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 from oslo_utils import excutils
 import sqlalchemy as sa
 from sqlalchemy import orm
@@ -28,7 +29,6 @@ from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.extensions import l3_ext_ha_mode as l3_ha
 from neutron.i18n import _LI, _LW
-from neutron.openstack.common import log as logging
 
 VR_ID_RANGE = set(range(1, 255))
 MAX_ALLOCATION_TRIES = 10
index 242c76d5b903d54631fe1cc2cb5538aa80c823cf..f5f1643fbe300916160b962e839cce4dc9c47deb 100644 (file)
@@ -13,6 +13,7 @@
 # under the License.
 
 import netaddr
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import orm
 from sqlalchemy import sql
@@ -24,7 +25,6 @@ from neutron.db import l3_db
 from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.extensions import metering
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 
 
index 96c1eb28ac770dc461d80d2cc3d8f6f9deb95f81..9fda950df60edebd506111ebfa2186df9b3675a8 100644 (file)
 # License for the specific language governing permissions and limitations
 # under the License.
 
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.common import constants as consts
 from neutron.common import utils
 from neutron.i18n import _LE
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as service_constants
 
 LOG = logging.getLogger(__name__)
index 14423a46f300e20d526fff407c73d873a78a923f..8585fdf851d40dde042c401351617acc916b2a1d 100644 (file)
@@ -12,6 +12,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import orm
 from sqlalchemy.orm import exc
@@ -21,7 +22,6 @@ from neutron.db import db_base_plugin_v2
 from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.extensions import portsecurity as psec
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 658f27514ed6676bb8af6482988ebd4ffe9a39cd..c12e60d1912db004f071e42ce7e1311b3201f9dc 100644 (file)
@@ -14,6 +14,7 @@
 
 import netaddr
 from oslo_db import exception
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import orm
 from sqlalchemy.orm import exc
@@ -25,7 +26,6 @@ from neutron.db import db_base_plugin_v2
 from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.extensions import securitygroup as ext_sg
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 
 LOG = logging.getLogger(__name__)
index 728312b535071f89f7d1799a079de8a4921e9431..c47493599e165f494bd7742d40a3c8763af6e2fc 100644 (file)
@@ -14,6 +14,7 @@
 #    under the License.
 
 import netaddr
+from oslo_log import log as logging
 from sqlalchemy.orm import exc
 
 from neutron.common import constants as q_const
@@ -24,7 +25,6 @@ from neutron.db import models_v2
 from neutron.db import securitygroups_db as sg_db
 from neutron.extensions import securitygroup as ext_sg
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 534ba1553db3cd61a0a00201a60e4ebc44b596bd..46a9a9448174e410c5b11df2b9846687af6ca704 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 import sqlalchemy as sa
 
 from neutron.db import model_base
-from neutron.openstack.common import log as logging
 from neutron.services import provider_configuration as pconf
 
 LOG = logging.getLogger(__name__)
index b21edc83e442b532728cfafd8218edf295242eae..f3df78fceb15303711c3c36fd493508d6e8befc4 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 from six import moves
 import sqlalchemy
 from sqlalchemy.orm import properties
 
 from neutron.common import exceptions as n_exc
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index f73703c2202b96b3c3d11b95265204f9ab4eb572..9f3d380c40abc717330911724cdf3c41e71e9b60 100644 (file)
@@ -17,9 +17,9 @@ from cliff import lister
 from neutronclient.common import utils
 from neutronclient.neutron import v2_0 as client
 from neutronclient.neutron.v2_0 import port
+from oslo_log import log as logging
 
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 
 
 class ProbeCommand(client.NeutronCommand):
index a7f35dadec3f01f0d62812d6eb32a7406fb1e918..0b6e053edbbd3a4066b1e86c53469750d9da70db 100644 (file)
@@ -18,12 +18,12 @@ import socket
 
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.agent.linux import dhcp
 from neutron.agent.linux import ip_lib
 from neutron.agent.linux import utils
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index c5937d932b46585bfa3da18d17f5c7d96d49d5f5..8679259bd31eaa3a5763ef95271eb77b5eac59d7 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
+
 from neutron.api import extensions
 from neutron.api.v2 import attributes
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index f18a7abdb314c3732d1f3150db09fe8a1cd24810..c786680a437d1d942de3c5e1f7db5d3ed6608032 100644 (file)
@@ -15,6 +15,7 @@
 
 import abc
 
+from oslo_log import log as logging
 import webob.exc
 
 from neutron.api import extensions
@@ -26,7 +27,6 @@ from neutron.common import rpc as n_rpc
 from neutron.extensions import agent
 from neutron.i18n import _LE
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as service_constants
 from neutron import policy
 from neutron import wsgi
index 06536799983c2e064825cd9267989b6e8f608db3..8485fc40d853bdec16ff785c606eff5fb196b28c 100644 (file)
 
 import abc
 
+from oslo_log import log as logging
 import six
 
 from neutron.api import extensions
 from neutron.api.v2 import attributes as attr
 from neutron.api.v2 import resource_helper
 from neutron.common import exceptions as nexception
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.services import service_base
 
index 5675c05c2735decba6d10bc3765010a3ead67758..a972f6f45e96fc9add85b2a679170fe671554ad6 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
+
 from neutron.api import extensions
 from neutron.api.v2 import attributes
 from neutron.api.v2 import base
 from neutron.db import servicetype_db
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index d19c71430bbcfdd2759073439e6927e49526bc4d..392f09d1526e708159ffecc6a4d48317ea504369 100644 (file)
@@ -29,8 +29,6 @@ import pep8
 #    neutron/tests/unit/hacking/test_checks.py
 
 _all_log_levels = {
-    # NOTE(yamamoto): Following nova which uses _() for audit.
-    'audit': '_',
     'error': '_LE',
     'info': '_LI',
     'warn': '_LW',
index cfae30667894cd0d89da9cbeaec84f7dcc382e0e..503d79448e7a557c1d3ad3d4fb2b7582f06e1214 100644 (file)
 import weakref
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import importutils
 
 from neutron.common import utils
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import periodic_task
 from neutron.plugins.common import constants
 
index 39b3af78558764f64fc1a7c66c18bcfb996a1e05..c31111f64de8f3107f3ec254fc57580881a4906c 100644 (file)
@@ -20,6 +20,7 @@ from keystoneclient import session as ks_session
 from novaclient import client as nova_client
 from novaclient import exceptions as nova_exceptions
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 from sqlalchemy.orm import attributes as sql_attr
 
@@ -27,7 +28,6 @@ from neutron.common import constants
 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 uuidutils
 
 
diff --git a/neutron/openstack/common/local.py b/neutron/openstack/common/local.py
deleted file mode 100644 (file)
index 0819d5b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2011 OpenStack Foundation.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-"""Local storage of variables using weak references"""
-
-import threading
-import weakref
-
-
-class WeakLocal(threading.local):
-    def __getattribute__(self, attr):
-        rval = super(WeakLocal, self).__getattribute__(attr)
-        if rval:
-            # NOTE(mikal): this bit is confusing. What is stored is a weak
-            # reference, not the value itself. We therefore need to lookup
-            # the weak reference and return the inner value here.
-            rval = rval()
-        return rval
-
-    def __setattr__(self, attr, value):
-        value = weakref.ref(value)
-        return super(WeakLocal, self).__setattr__(attr, value)
-
-
-# NOTE(mikal): the name "store" should be deprecated in the future
-store = WeakLocal()
-
-# A "weak" store uses weak references and allows an object to fall out of scope
-# when it falls out of scope in the code that uses the thread local storage. A
-# "strong" store will hold a reference to the object so that it never falls out
-# of scope.
-weak_store = WeakLocal()
-strong_store = threading.local()
diff --git a/neutron/openstack/common/log.py b/neutron/openstack/common/log.py
deleted file mode 100644 (file)
index ddb1891..0000000
+++ /dev/null
@@ -1,718 +0,0 @@
-# Copyright 2011 OpenStack Foundation.
-# Copyright 2010 United States Government as represented by the
-# Administrator of the National Aeronautics and Space Administration.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-"""OpenStack logging handler.
-
-This module adds to logging functionality by adding the option to specify
-a context object when calling the various log methods.  If the context object
-is not specified, default formatting is used. Additionally, an instance uuid
-may be passed as part of the log message, which is intended to make it easier
-for admins to find messages related to a specific instance.
-
-It also allows setting of formatting information through conf.
-
-"""
-
-import copy
-import inspect
-import itertools
-import logging
-import logging.config
-import logging.handlers
-import os
-import socket
-import sys
-import traceback
-
-from oslo.config import cfg
-from oslo.serialization import jsonutils
-from oslo.utils import importutils
-import six
-from six import moves
-
-_PY26 = sys.version_info[0:2] == (2, 6)
-
-from neutron.openstack.common._i18n import _
-from neutron.openstack.common import local
-
-
-_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
-
-
-common_cli_opts = [
-    cfg.BoolOpt('debug',
-                short='d',
-                default=False,
-                help='Print debugging output (set logging level to '
-                     'DEBUG instead of default WARNING level).'),
-    cfg.BoolOpt('verbose',
-                short='v',
-                default=False,
-                help='Print more verbose output (set logging level to '
-                     'INFO instead of default WARNING level).'),
-]
-
-logging_cli_opts = [
-    cfg.StrOpt('log-config-append',
-               metavar='PATH',
-               deprecated_name='log-config',
-               help='The name of a logging configuration file. This file '
-                    'is appended to any existing logging configuration '
-                    'files. For details about logging configuration files, '
-                    'see the Python logging module documentation.'),
-    cfg.StrOpt('log-format',
-               metavar='FORMAT',
-               help='DEPRECATED. '
-                    'A logging.Formatter log message format string which may '
-                    'use any of the available logging.LogRecord attributes. '
-                    'This option is deprecated.  Please use '
-                    'logging_context_format_string and '
-                    'logging_default_format_string instead.'),
-    cfg.StrOpt('log-date-format',
-               default=_DEFAULT_LOG_DATE_FORMAT,
-               metavar='DATE_FORMAT',
-               help='Format string for %%(asctime)s in log records. '
-                    'Default: %(default)s .'),
-    cfg.StrOpt('log-file',
-               metavar='PATH',
-               deprecated_name='logfile',
-               help='(Optional) Name of log file to output to. '
-                    'If no default is set, logging will go to stdout.'),
-    cfg.StrOpt('log-dir',
-               deprecated_name='logdir',
-               help='(Optional) The base directory used for relative '
-                    '--log-file paths.'),
-    cfg.BoolOpt('use-syslog',
-                default=False,
-                help='Use syslog for logging. '
-                     'Existing syslog format is DEPRECATED during I, '
-                     'and will change in J to honor RFC5424.'),
-    cfg.BoolOpt('use-syslog-rfc-format',
-                # TODO(bogdando) remove or use True after existing
-                #    syslog format deprecation in J
-                default=False,
-                help='(Optional) Enables or disables syslog rfc5424 format '
-                     'for logging. If enabled, prefixes the MSG part of the '
-                     'syslog message with APP-NAME (RFC5424). The '
-                     'format without the APP-NAME is deprecated in I, '
-                     'and will be removed in J.'),
-    cfg.StrOpt('syslog-log-facility',
-               default='LOG_USER',
-               help='Syslog facility to receive log lines.')
-]
-
-generic_log_opts = [
-    cfg.BoolOpt('use_stderr',
-                default=True,
-                help='Log output to standard error.')
-]
-
-DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'boto=WARN',
-                      'qpid=WARN', 'sqlalchemy=WARN', 'suds=INFO',
-                      'oslo.messaging=INFO', 'iso8601=WARN',
-                      'requests.packages.urllib3.connectionpool=WARN',
-                      'urllib3.connectionpool=WARN', 'websocket=WARN',
-                      "keystonemiddleware=WARN", "routes.middleware=WARN",
-                      "stevedore=WARN"]
-
-log_opts = [
-    cfg.StrOpt('logging_context_format_string',
-               default='%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
-                       '%(name)s [%(request_id)s %(user_identity)s] '
-                       '%(instance)s%(message)s',
-               help='Format string to use for log messages with context.'),
-    cfg.StrOpt('logging_default_format_string',
-               default='%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
-                       '%(name)s [-] %(instance)s%(message)s',
-               help='Format string to use for log messages without context.'),
-    cfg.StrOpt('logging_debug_format_suffix',
-               default='%(funcName)s %(pathname)s:%(lineno)d',
-               help='Data to append to log format when level is DEBUG.'),
-    cfg.StrOpt('logging_exception_prefix',
-               default='%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s '
-               '%(instance)s',
-               help='Prefix each line of exception output with this format.'),
-    cfg.ListOpt('default_log_levels',
-                default=DEFAULT_LOG_LEVELS,
-                help='List of logger=LEVEL pairs.'),
-    cfg.BoolOpt('publish_errors',
-                default=False,
-                help='Enables or disables publication of error events.'),
-    cfg.BoolOpt('fatal_deprecations',
-                default=False,
-                help='Enables or disables fatal status of deprecations.'),
-
-    # NOTE(mikal): there are two options here because sometimes we are handed
-    # a full instance (and could include more information), and other times we
-    # are just handed a UUID for the instance.
-    cfg.StrOpt('instance_format',
-               default='[instance: %(uuid)s] ',
-               help='The format for an instance that is passed with the log '
-                    'message.'),
-    cfg.StrOpt('instance_uuid_format',
-               default='[instance: %(uuid)s] ',
-               help='The format for an instance UUID that is passed with the '
-                    'log message.'),
-]
-
-CONF = cfg.CONF
-CONF.register_cli_opts(common_cli_opts)
-CONF.register_cli_opts(logging_cli_opts)
-CONF.register_opts(generic_log_opts)
-CONF.register_opts(log_opts)
-
-
-def list_opts():
-    """Entry point for oslo.config-generator."""
-    return [(None, copy.deepcopy(common_cli_opts)),
-            (None, copy.deepcopy(logging_cli_opts)),
-            (None, copy.deepcopy(generic_log_opts)),
-            (None, copy.deepcopy(log_opts)),
-            ]
-
-
-# our new audit level
-# NOTE(jkoelker) Since we synthesized an audit level, make the logging
-#                module aware of it so it acts like other levels.
-logging.AUDIT = logging.INFO + 1
-logging.addLevelName(logging.AUDIT, 'AUDIT')
-
-
-try:
-    NullHandler = logging.NullHandler
-except AttributeError:  # NOTE(jkoelker) NullHandler added in Python 2.7
-    class NullHandler(logging.Handler):
-        def handle(self, record):
-            pass
-
-        def emit(self, record):
-            pass
-
-        def createLock(self):
-            self.lock = None
-
-
-def _dictify_context(context):
-    if context is None:
-        return None
-    if not isinstance(context, dict) and getattr(context, 'to_dict', None):
-        context = context.to_dict()
-    return context
-
-
-def _get_binary_name():
-    return os.path.basename(inspect.stack()[-1][1])
-
-
-def _get_log_file_path(binary=None):
-    logfile = CONF.log_file
-    logdir = CONF.log_dir
-
-    if logfile and not logdir:
-        return logfile
-
-    if logfile and logdir:
-        return os.path.join(logdir, logfile)
-
-    if logdir:
-        binary = binary or _get_binary_name()
-        return '%s.log' % (os.path.join(logdir, binary),)
-
-    return None
-
-
-class BaseLoggerAdapter(logging.LoggerAdapter):
-
-    def audit(self, msg, *args, **kwargs):
-        self.log(logging.AUDIT, msg, *args, **kwargs)
-
-    def isEnabledFor(self, level):
-        if _PY26:
-            # This method was added in python 2.7 (and it does the exact
-            # same logic, so we need to do the exact same logic so that
-            # python 2.6 has this capability as well).
-            return self.logger.isEnabledFor(level)
-        else:
-            return super(BaseLoggerAdapter, self).isEnabledFor(level)
-
-
-class LazyAdapter(BaseLoggerAdapter):
-    def __init__(self, name='unknown', version='unknown'):
-        self._logger = None
-        self.extra = {}
-        self.name = name
-        self.version = version
-
-    @property
-    def logger(self):
-        if not self._logger:
-            self._logger = getLogger(self.name, self.version)
-            if six.PY3:
-                # In Python 3, the code fails because the 'manager' attribute
-                # cannot be found when using a LoggerAdapter as the
-                # underlying logger. Work around this issue.
-                self._logger.manager = self._logger.logger.manager
-        return self._logger
-
-
-class ContextAdapter(BaseLoggerAdapter):
-    warn = logging.LoggerAdapter.warning
-
-    def __init__(self, logger, project_name, version_string):
-        self.logger = logger
-        self.project = project_name
-        self.version = version_string
-        self._deprecated_messages_sent = dict()
-
-    @property
-    def handlers(self):
-        return self.logger.handlers
-
-    def deprecated(self, msg, *args, **kwargs):
-        """Call this method when a deprecated feature is used.
-
-        If the system is configured for fatal deprecations then the message
-        is logged at the 'critical' level and :class:`DeprecatedConfig` will
-        be raised.
-
-        Otherwise, the message will be logged (once) at the 'warn' level.
-
-        :raises: :class:`DeprecatedConfig` if the system is configured for
-                 fatal deprecations.
-
-        """
-        stdmsg = _("Deprecated: %s") % msg
-        if CONF.fatal_deprecations:
-            self.critical(stdmsg, *args, **kwargs)
-            raise DeprecatedConfig(msg=stdmsg)
-
-        # Using a list because a tuple with dict can't be stored in a set.
-        sent_args = self._deprecated_messages_sent.setdefault(msg, list())
-
-        if args in sent_args:
-            # Already logged this message, so don't log it again.
-            return
-
-        sent_args.append(args)
-        self.warn(stdmsg, *args, **kwargs)
-
-    def process(self, msg, kwargs):
-        # NOTE(jecarey): If msg is not unicode, coerce it into unicode
-        #                before it can get to the python logging and
-        #                possibly cause string encoding trouble
-        if not isinstance(msg, six.text_type):
-            msg = six.text_type(msg)
-
-        if 'extra' not in kwargs:
-            kwargs['extra'] = {}
-        extra = kwargs['extra']
-
-        context = kwargs.pop('context', None)
-        if not context:
-            context = getattr(local.store, 'context', None)
-        if context:
-            extra.update(_dictify_context(context))
-
-        instance = kwargs.pop('instance', None)
-        instance_uuid = (extra.get('instance_uuid') or
-                         kwargs.pop('instance_uuid', None))
-        instance_extra = ''
-        if instance:
-            instance_extra = CONF.instance_format % instance
-        elif instance_uuid:
-            instance_extra = (CONF.instance_uuid_format
-                              % {'uuid': instance_uuid})
-        extra['instance'] = instance_extra
-
-        extra.setdefault('user_identity', kwargs.pop('user_identity', None))
-
-        extra['project'] = self.project
-        extra['version'] = self.version
-        extra['extra'] = extra.copy()
-        return msg, kwargs
-
-
-class JSONFormatter(logging.Formatter):
-    def __init__(self, fmt=None, datefmt=None):
-        # NOTE(jkoelker) we ignore the fmt argument, but its still there
-        #                since logging.config.fileConfig passes it.
-        self.datefmt = datefmt
-
-    def formatException(self, ei, strip_newlines=True):
-        lines = traceback.format_exception(*ei)
-        if strip_newlines:
-            lines = [moves.filter(
-                lambda x: x,
-                line.rstrip().splitlines()) for line in lines]
-            lines = list(itertools.chain(*lines))
-        return lines
-
-    def format(self, record):
-        message = {'message': record.getMessage(),
-                   'asctime': self.formatTime(record, self.datefmt),
-                   'name': record.name,
-                   'msg': record.msg,
-                   'args': record.args,
-                   'levelname': record.levelname,
-                   'levelno': record.levelno,
-                   'pathname': record.pathname,
-                   'filename': record.filename,
-                   'module': record.module,
-                   'lineno': record.lineno,
-                   'funcname': record.funcName,
-                   'created': record.created,
-                   'msecs': record.msecs,
-                   'relative_created': record.relativeCreated,
-                   'thread': record.thread,
-                   'thread_name': record.threadName,
-                   'process_name': record.processName,
-                   'process': record.process,
-                   'traceback': None}
-
-        if hasattr(record, 'extra'):
-            message['extra'] = record.extra
-
-        if record.exc_info:
-            message['traceback'] = self.formatException(record.exc_info)
-
-        return jsonutils.dumps(message)
-
-
-def _create_logging_excepthook(product_name):
-    def logging_excepthook(exc_type, value, tb):
-        extra = {'exc_info': (exc_type, value, tb)}
-        getLogger(product_name).critical(
-            "".join(traceback.format_exception_only(exc_type, value)),
-            **extra)
-    return logging_excepthook
-
-
-class LogConfigError(Exception):
-
-    message = _('Error loading logging config %(log_config)s: %(err_msg)s')
-
-    def __init__(self, log_config, err_msg):
-        self.log_config = log_config
-        self.err_msg = err_msg
-
-    def __str__(self):
-        return self.message % dict(log_config=self.log_config,
-                                   err_msg=self.err_msg)
-
-
-def _load_log_config(log_config_append):
-    try:
-        logging.config.fileConfig(log_config_append,
-                                  disable_existing_loggers=False)
-    except (moves.configparser.Error, KeyError) as exc:
-        raise LogConfigError(log_config_append, six.text_type(exc))
-
-
-def setup(product_name, version='unknown'):
-    """Setup logging."""
-    if CONF.log_config_append:
-        _load_log_config(CONF.log_config_append)
-    else:
-        _setup_logging_from_conf(product_name, version)
-    sys.excepthook = _create_logging_excepthook(product_name)
-
-
-def set_defaults(logging_context_format_string=None,
-                 default_log_levels=None):
-    # Just in case the caller is not setting the
-    # default_log_level. This is insurance because
-    # we introduced the default_log_level parameter
-    # later in a backwards in-compatible change
-    if default_log_levels is not None:
-        cfg.set_defaults(
-            log_opts,
-            default_log_levels=default_log_levels)
-    if logging_context_format_string is not None:
-        cfg.set_defaults(
-            log_opts,
-            logging_context_format_string=logging_context_format_string)
-
-
-def _find_facility_from_conf():
-    facility_names = logging.handlers.SysLogHandler.facility_names
-    facility = getattr(logging.handlers.SysLogHandler,
-                       CONF.syslog_log_facility,
-                       None)
-
-    if facility is None and CONF.syslog_log_facility in facility_names:
-        facility = facility_names.get(CONF.syslog_log_facility)
-
-    if facility is None:
-        valid_facilities = facility_names.keys()
-        consts = ['LOG_AUTH', 'LOG_AUTHPRIV', 'LOG_CRON', 'LOG_DAEMON',
-                  'LOG_FTP', 'LOG_KERN', 'LOG_LPR', 'LOG_MAIL', 'LOG_NEWS',
-                  'LOG_AUTH', 'LOG_SYSLOG', 'LOG_USER', 'LOG_UUCP',
-                  'LOG_LOCAL0', 'LOG_LOCAL1', 'LOG_LOCAL2', 'LOG_LOCAL3',
-                  'LOG_LOCAL4', 'LOG_LOCAL5', 'LOG_LOCAL6', 'LOG_LOCAL7']
-        valid_facilities.extend(consts)
-        raise TypeError(_('syslog facility must be one of: %s') %
-                        ', '.join("'%s'" % fac
-                                  for fac in valid_facilities))
-
-    return facility
-
-
-class RFCSysLogHandler(logging.handlers.SysLogHandler):
-    def __init__(self, *args, **kwargs):
-        self.binary_name = _get_binary_name()
-        # Do not use super() unless type(logging.handlers.SysLogHandler)
-        #  is 'type' (Python 2.7).
-        # Use old style calls, if the type is 'classobj' (Python 2.6)
-        logging.handlers.SysLogHandler.__init__(self, *args, **kwargs)
-
-    def format(self, record):
-        # Do not use super() unless type(logging.handlers.SysLogHandler)
-        #  is 'type' (Python 2.7).
-        # Use old style calls, if the type is 'classobj' (Python 2.6)
-        msg = logging.handlers.SysLogHandler.format(self, record)
-        msg = self.binary_name + ' ' + msg
-        return msg
-
-
-def _setup_logging_from_conf(project, version):
-    log_root = getLogger(None).logger
-    for handler in log_root.handlers:
-        log_root.removeHandler(handler)
-
-    logpath = _get_log_file_path()
-    if logpath:
-        filelog = logging.handlers.WatchedFileHandler(logpath)
-        log_root.addHandler(filelog)
-
-    if CONF.use_stderr:
-        streamlog = ColorHandler()
-        log_root.addHandler(streamlog)
-
-    elif not logpath:
-        # pass sys.stdout as a positional argument
-        # python2.6 calls the argument strm, in 2.7 it's stream
-        streamlog = logging.StreamHandler(sys.stdout)
-        log_root.addHandler(streamlog)
-
-    if CONF.publish_errors:
-        handler = importutils.import_object(
-            "oslo.messaging.notify.log_handler.PublishErrorsHandler",
-            logging.ERROR)
-        log_root.addHandler(handler)
-
-    datefmt = CONF.log_date_format
-    for handler in log_root.handlers:
-        # NOTE(alaski): CONF.log_format overrides everything currently.  This
-        # should be deprecated in favor of context aware formatting.
-        if CONF.log_format:
-            handler.setFormatter(logging.Formatter(fmt=CONF.log_format,
-                                                   datefmt=datefmt))
-            log_root.info('Deprecated: log_format is now deprecated and will '
-                          'be removed in the next release')
-        else:
-            handler.setFormatter(ContextFormatter(project=project,
-                                                  version=version,
-                                                  datefmt=datefmt))
-
-    if CONF.debug:
-        log_root.setLevel(logging.DEBUG)
-    elif CONF.verbose:
-        log_root.setLevel(logging.INFO)
-    else:
-        log_root.setLevel(logging.WARNING)
-
-    for pair in CONF.default_log_levels:
-        mod, _sep, level_name = pair.partition('=')
-        logger = logging.getLogger(mod)
-        # NOTE(AAzza) in python2.6 Logger.setLevel doesn't convert string name
-        # to integer code.
-        if sys.version_info < (2, 7):
-            level = logging.getLevelName(level_name)
-            logger.setLevel(level)
-        else:
-            logger.setLevel(level_name)
-
-    if CONF.use_syslog:
-        try:
-            facility = _find_facility_from_conf()
-            # TODO(bogdando) use the format provided by RFCSysLogHandler
-            #   after existing syslog format deprecation in J
-            if CONF.use_syslog_rfc_format:
-                syslog = RFCSysLogHandler(address='/dev/log',
-                                          facility=facility)
-            else:
-                syslog = logging.handlers.SysLogHandler(address='/dev/log',
-                                                        facility=facility)
-            log_root.addHandler(syslog)
-        except socket.error:
-            log_root.error('Unable to add syslog handler. Verify that syslog '
-                           'is running.')
-
-
-_loggers = {}
-
-
-def getLogger(name='unknown', version='unknown'):
-    if name not in _loggers:
-        _loggers[name] = ContextAdapter(logging.getLogger(name),
-                                        name,
-                                        version)
-    return _loggers[name]
-
-
-def getLazyLogger(name='unknown', version='unknown'):
-    """Returns lazy logger.
-
-    Creates a pass-through logger that does not create the real logger
-    until it is really needed and delegates all calls to the real logger
-    once it is created.
-    """
-    return LazyAdapter(name, version)
-
-
-class WritableLogger(object):
-    """A thin wrapper that responds to `write` and logs."""
-
-    def __init__(self, logger, level=logging.INFO):
-        self.logger = logger
-        self.level = level
-
-    def write(self, msg):
-        self.logger.log(self.level, msg.rstrip())
-
-
-class ContextFormatter(logging.Formatter):
-    """A context.RequestContext aware formatter configured through flags.
-
-    The flags used to set format strings are: logging_context_format_string
-    and logging_default_format_string.  You can also specify
-    logging_debug_format_suffix to append extra formatting if the log level is
-    debug.
-
-    For information about what variables are available for the formatter see:
-    http://docs.python.org/library/logging.html#formatter
-
-    If available, uses the context value stored in TLS - local.store.context
-
-    """
-
-    def __init__(self, *args, **kwargs):
-        """Initialize ContextFormatter instance
-
-        Takes additional keyword arguments which can be used in the message
-        format string.
-
-        :keyword project: project name
-        :type project: string
-        :keyword version: project version
-        :type version: string
-
-        """
-
-        self.project = kwargs.pop('project', 'unknown')
-        self.version = kwargs.pop('version', 'unknown')
-
-        logging.Formatter.__init__(self, *args, **kwargs)
-
-    def format(self, record):
-        """Uses contextstring if request_id is set, otherwise default."""
-
-        # NOTE(jecarey): If msg is not unicode, coerce it into unicode
-        #                before it can get to the python logging and
-        #                possibly cause string encoding trouble
-        if not isinstance(record.msg, six.text_type):
-            record.msg = six.text_type(record.msg)
-
-        # store project info
-        record.project = self.project
-        record.version = self.version
-
-        # store request info
-        context = getattr(local.store, 'context', None)
-        if context:
-            d = _dictify_context(context)
-            for k, v in d.items():
-                setattr(record, k, v)
-
-        # NOTE(sdague): default the fancier formatting params
-        # to an empty string so we don't throw an exception if
-        # they get used
-        for key in ('instance', 'color', 'user_identity'):
-            if key not in record.__dict__:
-                record.__dict__[key] = ''
-
-        if record.__dict__.get('request_id'):
-            fmt = CONF.logging_context_format_string
-        else:
-            fmt = CONF.logging_default_format_string
-
-        if (record.levelno == logging.DEBUG and
-                CONF.logging_debug_format_suffix):
-            fmt += " " + CONF.logging_debug_format_suffix
-
-        if sys.version_info < (3, 2):
-            self._fmt = fmt
-        else:
-            self._style = logging.PercentStyle(fmt)
-            self._fmt = self._style._fmt
-        # Cache this on the record, Logger will respect our formatted copy
-        if record.exc_info:
-            record.exc_text = self.formatException(record.exc_info, record)
-        return logging.Formatter.format(self, record)
-
-    def formatException(self, exc_info, record=None):
-        """Format exception output with CONF.logging_exception_prefix."""
-        if not record:
-            return logging.Formatter.formatException(self, exc_info)
-
-        stringbuffer = moves.StringIO()
-        traceback.print_exception(exc_info[0], exc_info[1], exc_info[2],
-                                  None, stringbuffer)
-        lines = stringbuffer.getvalue().split('\n')
-        stringbuffer.close()
-
-        if CONF.logging_exception_prefix.find('%(asctime)') != -1:
-            record.asctime = self.formatTime(record, self.datefmt)
-
-        formatted_lines = []
-        for line in lines:
-            pl = CONF.logging_exception_prefix % record.__dict__
-            fl = '%s%s' % (pl, line)
-            formatted_lines.append(fl)
-        return '\n'.join(formatted_lines)
-
-
-class ColorHandler(logging.StreamHandler):
-    LEVEL_COLORS = {
-        logging.DEBUG: '\033[00;32m',  # GREEN
-        logging.INFO: '\033[00;36m',  # CYAN
-        logging.AUDIT: '\033[01;36m',  # BOLD CYAN
-        logging.WARN: '\033[01;33m',  # BOLD YELLOW
-        logging.ERROR: '\033[01;31m',  # BOLD RED
-        logging.CRITICAL: '\033[01;31m',  # BOLD RED
-    }
-
-    def format(self, record):
-        record.color = self.LEVEL_COLORS[record.levelno]
-        return logging.StreamHandler.format(self, record)
-
-
-class DeprecatedConfig(Exception):
-    message = _("Fatal call to deprecated config: %(msg)s")
-
-    def __init__(self, msg):
-        super(Exception, self).__init__(self.message % dict(msg=msg))
index b922b03ae0048d79504819d6c162855000c13e04..cfb1d65d6d623b9dea153eae27bfb71370286fa0 100644 (file)
@@ -21,6 +21,7 @@
 
 from oslo_config import cfg
 from oslo_context import context as oslo_context
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import importutils
 
@@ -47,7 +48,6 @@ from neutron.db import securitygroups_rpc_base as sg_db_rpc
 from neutron.extensions import portbindings
 from neutron.extensions import securitygroup as ext_sg
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.brocade.db import models as brocade_db
 from neutron.plugins.brocade import vlanbm as vbm
 from neutron.plugins.common import constants as svc_constants
index 64c824eef240ea6b8d797e430314ee09a50b5c40..3d87d939a780c265a0f211158d06e2873abf3c86 100644 (file)
@@ -19,10 +19,10 @@ Neutron network life-cycle management.
 """
 
 from ncclient import manager
+from oslo_log import log as logging
 from oslo_utils import excutils
 
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron.plugins.brocade.nos import nctemplates as template
 
 
index 41213b1a1eb73a110e786be11aa1cdd1a56fbf80..0becd48e411d6e7519506284052371c726e00eab 100644 (file)
@@ -21,7 +21,8 @@ from __future__ import print_function
 
 import argparse
 
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
+
 from neutron.plugins.brocade.nos import nosdriver as nos
 
 LOG = logging.getLogger(__name__)
index 5ba7c1e508dff12510e11a66bca50dbfa4564a71..aca3eca49a7acf053fef0f99a5c842608439ad11 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import netaddr
 import re
+
+import netaddr
+from oslo_log import log as logging
 from sqlalchemy.orm import exc
 from sqlalchemy import sql
 
@@ -23,7 +25,6 @@ from neutron.common import exceptions as n_exc
 import neutron.db.api as db
 from neutron.db import models_v2
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.cisco.common import cisco_constants as c_const
 from neutron.plugins.cisco.common import cisco_exceptions as c_exc
 from neutron.plugins.cisco.common import config as c_conf
index dbbbfb0919d4116a3e574c6b97f2feee5f05ed7a..bb7c446a1b9b3cc507bb8bf1b29e0720c08214de 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 import sqlalchemy as sa
 from sqlalchemy import sql
 
 from neutron.db import model_base
 from neutron.db import models_v2
-from neutron.openstack.common import log as logging
 from neutron.plugins.cisco.common import cisco_constants
 
 
index f4724865b27a3bf1229e6f127e3f1f7b5c0055d4..dab2e071a32e18f5561e1b97522d3cb373b349f2 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 from sqlalchemy.orm import exc
 
 from neutron.db import api as db
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.plugins.cisco.common import cisco_constants as const
 from neutron.plugins.cisco.common import cisco_exceptions as c_exc
index 95d0a0a721b41e335142be96691c9d693da455af..13fecd6ae663fc1fd2c7c103860fb11d167f0e5d 100644 (file)
@@ -15,6 +15,7 @@
 
 import inspect
 
+from oslo_log import log as logging
 from oslo_utils import excutils
 from oslo_utils import importutils
 
@@ -23,7 +24,6 @@ from neutron.extensions import portbindings
 from neutron.extensions import providernet as provider
 from neutron.i18n import _LE, _LI
 from neutron import neutron_plugin_base_v2
-from neutron.openstack.common import log as logging
 from neutron.plugins.cisco.common import cisco_constants as const
 from neutron.plugins.cisco.common import cisco_credentials_v2 as cred
 from neutron.plugins.cisco.common import config as conf
index 9df4a4541a1d59cd1b9dd9296f88b0305535732f..f7a54f50fc8ebe00c10abb3175a1b7d2638fa619 100644 (file)
@@ -16,12 +16,12 @@ import base64
 
 import eventlet
 import netaddr
+from oslo_log import log as logging
 from oslo_serialization import jsonutils
 import requests
 
 from neutron.common import exceptions as n_exc
 from neutron.extensions import providernet
-from neutron.openstack.common import log as logging
 from neutron.plugins.cisco.common import cisco_constants as c_const
 from neutron.plugins.cisco.common import cisco_credentials_v2 as c_cred
 from neutron.plugins.cisco.common import cisco_exceptions as c_exc
index cb4b9b907cffc220d0d0f029000717c69f4e1fca..0b022947924d64cc1d2d2494f6c014e136545406 100644 (file)
@@ -13,8 +13,8 @@
 #    under the License.
 
 import eventlet
-
 from oslo_config import cfg as q_conf
+from oslo_log import log as logging
 from oslo_utils import excutils
 from oslo_utils import importutils
 
@@ -37,7 +37,6 @@ from neutron.extensions import portbindings
 from neutron.extensions import providernet
 from neutron.i18n import _LW
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils as uuidutils
 from neutron.plugins.cisco.common import cisco_constants as c_const
 from neutron.plugins.cisco.common import cisco_credentials_v2 as c_cred
index 36ada7bf1f2347e3c94ddba6095c54b5b2830b49..efeda970860b3c49d09d707189ccbee96ad640c3 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
 from oslo_utils import importutils
 import webob.exc as wexc
 
 from neutron.api import extensions as neutron_extensions
 from neutron.api.v2 import base
 from neutron.db import db_base_plugin_v2
-from neutron.openstack.common import log as logging
 from neutron.plugins.cisco.common import cisco_exceptions as cexc
 from neutron.plugins.cisco.common import config
 from neutron.plugins.cisco.db import network_db_v2 as cdb
index 2ce7db1b0a76303a0f2e40e4cc69050cca4be1b5..fb5101f88e7c2598447455442839bcc0bef7dcef 100644 (file)
@@ -17,9 +17,9 @@ from eventlet import greenthread
 from eventlet import queue
 from heleosapi import constants as h_con
 from heleosapi import exceptions as h_exc
+from oslo_log import log as logging
 
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron.plugins.embrane.agent.operations import router_operations
 from neutron.plugins.embrane.common import constants as p_con
 from neutron.plugins.embrane.common import contexts as ctx
index c5cdcbbb9c701b73f87222444e1a1bf060d509d3..e32f8adb7d20fefb613ec13d33a232fdd496e5ec 100644 (file)
@@ -16,9 +16,9 @@
 import functools
 
 from heleosapi import exceptions as h_exc
+from oslo_log import log as logging
 
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.embrane.common import constants as p_con
 
 LOG = logging.getLogger(__name__)
index 3cf64945e9bf6ef10e57e184942351d103a5f4e0..3995d4c6c659491efd9a48dbbe4d1abf9edbc066 100644 (file)
@@ -17,6 +17,7 @@ from heleosapi import backend_operations as h_op
 from heleosapi import constants as h_con
 from heleosapi import exceptions as h_exc
 from oslo_config import cfg
+from oslo_log import log as logging
 from sqlalchemy.orm import exc
 
 from neutron.common import constants as l3_constants
@@ -26,7 +27,6 @@ from neutron.db import l3_db
 from neutron.db import models_v2
 from neutron.extensions import l3
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron.plugins.embrane.agent import dispatcher
 from neutron.plugins.embrane.common import config  # noqa
 from neutron.plugins.embrane.common import constants as p_con
index 8eb4451a6b1e39b5d5f884a118e9f9b8ba72bb3b..fbf6109fe054288a8d2f64670de6eb4c4b4145b5 100644 (file)
 #    under the License.
 
 from heleosapi import info as h_info
+from oslo_log import log as logging
 
 from neutron.common import constants
 from neutron.db import models_v2
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 58580f5bd43ee5978189c2804d5004a8accf30a6..37bb6e724f423d60eebf705638c8b20f9f68d67b 100644 (file)
@@ -23,6 +23,7 @@ import eventlet
 eventlet.monkey_patch()
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.agent.common import config
@@ -33,7 +34,6 @@ from neutron.common import constants as n_const
 from neutron.common import topics
 from neutron import context
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.hyperv.agent import utils
index f275f6ecca7cd4aed3996f86310ef50af8130a97..12cfd5befae2abdffbfca27e78530d2258727309 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
+
 from neutron.agent import firewall
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.hyperv.agent import utilsfactory
 from neutron.plugins.hyperv.agent import utilsv2
 
index 320b3b9185b1f6be763bacb4851cb55be8878756..029e7c9eaf110c2a7e5ce697851e93f294569b89 100644 (file)
@@ -18,9 +18,9 @@ import sys
 import time
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.common import exceptions as n_exc
-from neutron.openstack.common import log as logging
 
 # Check needed for unit testing on Unix
 if sys.platform == 'win32':
index 89aa109d159d13923a263154a27f6f6aaa10e3c7..4bc0165c2428cac8aaefb6de33b563b5890a9305 100644 (file)
@@ -16,9 +16,9 @@
 import sys
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.hyperv.agent import utils
 from neutron.plugins.hyperv.agent import utilsv2
 
index 00e7adc83b4f4e786cd3b194eb1ba290313b585e..6434df544d561cd4489a70ec59a88a45c00cbeb4 100644 (file)
@@ -23,6 +23,7 @@ import eventlet
 eventlet.monkey_patch()
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.agent.linux import ip_lib
@@ -34,7 +35,6 @@ from neutron.common import topics
 from neutron.common import utils as n_utils
 from neutron.i18n import _LE, _LI
 from neutron import context
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 from neutron.plugins.ibm.common import constants
 
index e992d8dc539bf90f51c3a4c9acc950c9491c4853..91fe62f18c43c73fb9c269e9c58562468fbf4c0f 100644 (file)
@@ -21,11 +21,11 @@ import urllib
 import httplib2
 from keystoneclient.v2_0 import client as keyclient
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.api.v2 import attributes
 from neutron.common import utils
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.ibm.common import config  # noqa
 from neutron.plugins.ibm.common import constants
 from neutron import wsgi
index b1deeb1b6101fe49a5969b0f384a42237de01f4f..a6c0aeedfc836c180e597858ec34b2e3d714adf6 100644 (file)
@@ -14,8 +14,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
+
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.ibm.common import constants
 
 LOG = logging.getLogger(__name__)
index 92b5c4047fba61b01dc29163ddd6cfd87ac4ddab..87cd5d5d10750e0e2e3e08d79940937412e1f142 100644 (file)
@@ -18,6 +18,7 @@
 import functools
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import excutils
 
@@ -33,7 +34,6 @@ from neutron.db import portbindings_db
 from neutron.db import quota_db  # noqa
 from neutron.extensions import portbindings
 from neutron.i18n import _LE, _LI, _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.ibm.common import config  # noqa
 from neutron.plugins.ibm.common import constants
 from neutron.plugins.ibm.common import exceptions as sdnve_exc
index 8f0193009a54740fd5b2b9d1193fe94a8d7f43d0..35aa66ab43523b7a007f42f0128385ba88ad1fc1 100755 (executable)
@@ -27,6 +27,7 @@ import eventlet
 eventlet.monkey_patch()
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from six import moves
 
@@ -42,7 +43,6 @@ from neutron.common import topics
 from neutron.common import utils as q_utils
 from neutron import context
 from neutron.i18n import _LE, _LI, _LW
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.linuxbridge.common import config  # noqa
index 8456d214ad06ec8b19ce3dcb533e06d4b1dd1fcb..73523ac74daff2de94f9b1eb6b3779417b42be8e 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_db import exception as db_exc
+from oslo_log import log
 from sqlalchemy import or_
 from sqlalchemy.orm import exc
 
-from oslo_db import exception as db_exc
-
 from neutron.common import constants as n_const
 from neutron.db import api as db_api
 from neutron.db import models_v2
@@ -25,7 +25,6 @@ from neutron.db import securitygroups_db as sg_db
 from neutron.extensions import portbindings
 from neutron.i18n import _LE, _LI
 from neutron import manager
-from neutron.openstack.common import log
 from neutron.openstack.common import uuidutils
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2 import models
index 88ff031db296b4e0d4525cf9674250e775707c71..b0a77fa20d87b59afa5b837b511af844aad19871 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log
 from oslo_serialization import jsonutils
 
 from neutron.common import constants
 from neutron.extensions import portbindings
 from neutron.i18n import _LW
-from neutron.openstack.common import log
 from neutron.plugins.ml2 import db
 from neutron.plugins.ml2 import driver_api as api
 
index d99cdf4ce747475b5053d947b00ce5acf884037e..4011f1c38cb9bc1b5f29da523f51966bafd651b6 100644 (file)
@@ -18,10 +18,10 @@ import threading
 from networking_arista.common import db_lib
 from networking_arista.ml2 import arista_ml2
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.common import constants as n_const
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.ml2.common import exceptions as ml2_exc
 from neutron.plugins.ml2 import driver_api
 from neutron.plugins.ml2.drivers.arista import config  # noqa
index a0592b3cc85b5b49c6952a442f47026845b10fd2..dd98bf7d4d97b79d7b81d93972fba968a931fbc4 100644 (file)
 """Implentation of Brocade ML2 Mechanism driver for ML2 Plugin."""
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import excutils
 from oslo_utils import importutils
 
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.ml2 import driver_api
 from neutron.plugins.ml2.drivers.brocade.db import models as brocade_db
 
index a0a607ca3fbca8be44a9a5d0b51be3eac50e41c4..1ae52d331fe7d5bea3b2e387244f41034e181dda 100644 (file)
@@ -19,11 +19,11 @@ Neutron network life-cycle management.
 """
 
 from ncclient import manager
+from oslo_log import log as logging
 from oslo_utils import excutils
 from xml.etree import ElementTree
 
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron.plugins.ml2.drivers.brocade.nos import nctemplates as template
 
 
index b72cd6b8e6f7d98f269ff071b668157e0914bcf9..08873d70219defcdac8e8719bd09830c061e2cb4 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log
+
 from neutron.common import constants as n_constants
 from neutron import context
 from neutron.i18n import _LW
 from neutron import manager
-from neutron.openstack.common import log
 from neutron.openstack.common import loopingcall
 from neutron.plugins.ml2 import db as l2_db
 from neutron.plugins.ml2 import driver_context
index 10fbc377da12bbc763708f766ad374e90d29ee3a..d4901bcf84c19eff1d1936cbe7242833746fd6ae 100644 (file)
@@ -17,11 +17,11 @@ import re
 import sys
 
 import eventlet
-
 eventlet.monkey_patch()
 
 from oslo_concurrency import lockutils
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.agent.common import config
@@ -33,7 +33,6 @@ from neutron.common import utils as neutron_utils
 from neutron.db import agents_db
 from neutron.i18n import _LE, _LI
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import periodic_task
 from neutron.openstack.common import service as svc
 from neutron.plugins.ml2.drivers.cisco.apic import mechanism_apic as ma
index f6fa93b098c2c7b073db742f4bc4ae0d30291cb6..bb40f26bb27312f202fc237832926e6e29fc1bd6 100644 (file)
@@ -18,9 +18,9 @@ from keystoneclient.v2_0 import client as keyclient
 import netaddr
 from oslo_concurrency import lockutils
 from oslo_config import cfg
+from oslo_log import log
 
 from neutron.common import constants as n_constants
-from neutron.openstack.common import log
 from neutron.plugins.common import constants
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2.drivers.cisco.apic import apic_model
index 0637042319010a27a5e89404d7724fad0d26e614..8fcfa721c8795f8ee75a6dbd9a572b0b6e545cf6 100644 (file)
 import re
 
 from oslo_config import cfg
+from oslo_log import log
 from oslo_serialization import jsonutils
 import requests
 
-from neutron.openstack.common import log
 from neutron.plugins.ml2 import driver_api as api
 
 LOG = log.getLogger(__name__)
index cc594dc8e2d3001ed8fe76e6e761c24429f5eb30..4c750ea7fa3e18a2280e7cfe6372c557994d829e 100755 (executable)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from oslo_log import log as logging
+
 from neutron.common import constants as n_const
 from neutron.common import log
 from neutron.extensions import portbindings
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2.drivers.freescale import config  # noqa
index e39b53a7d08d24c10bbf690ba48a9e2afa6ca67d..e4da1d412ca59e81dc1da3ebb90b5b5a0ca17ad1 100644 (file)
 #    under the License.
 
 from oslo_db import exception as db_exc
+from oslo_log import log
 
 from neutron.common import exceptions as exc
 from neutron.i18n import _LW
-from neutron.openstack.common import log
 from neutron.plugins.ml2 import driver_api as api
 
 
index 99f569889990341a5dbf9056774a4b9d93cc766a..5420e827a7c11584697488bd4055e3e192512dd8 100644 (file)
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.common import constants as const
 from neutron import context as n_context
 from neutron.db import api as db_api
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.ml2.common import exceptions as ml2_exc
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2.drivers.l2pop import config  # noqa
index 5dd7378bfaaec5ebf3f8f434ece9f48a459345ec..afa7e1b2a62f449c9acfc5be6acd4578d7219b4c 100644 (file)
 import collections
 import copy
 
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.common import rpc as n_rpc
 from neutron.common import topics
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 08365141e15ba32c6bde2249e5ef275950da15c5..03fd8dc0db9e8998eeec93a2d0acac9c8da5cb98 100644 (file)
 import abc
 import six
 
+from oslo_log import log
+
 from neutron.extensions import portbindings
 from neutron.i18n import _LW
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_constants
 from neutron.plugins.ml2 import driver_api as api
 
index 1eb584f12c3b7258200e407d84da61da295a17bf..1d0697908709a1f7a6faaad49e27aa2639403522 100644 (file)
 
 import re
 
+from oslo_log import log
+
 from neutron.common import constants
 from neutron.extensions import portbindings
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_constants
 from neutron.plugins.ml2.drivers import mech_agent
 
index c5e4539424314a448445ef88509ffc9334cbd87f..221b2abfab15f3752f3ec6cc82e0d5f61790fbe0 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log
+
 from neutron.agent import securitygroups_rpc
 from neutron.common import constants
 from neutron.extensions import portbindings
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_constants
 from neutron.plugins.ml2.drivers import mech_agent
 
index d09ba83943c08998a954b24bf006caeea23dcd5d..971c195b4d380a34e12f0b01e3c0d0f2045d5a65 100644 (file)
 
 import netaddr
 from oslo_config import cfg
+from oslo_log import log
 
 from neutron.common import constants as n_consts
 from neutron.extensions import portbindings
 from neutron.i18n import _LE
-from neutron.openstack.common import log
 from neutron.plugins.common import constants
 from neutron.plugins.ml2 import driver_api as api
 from nuage_neutron.plugins.nuage.common import config
index 5e20a4b354f8405153ebb23bdc24e0022490967e..668b3832ec74ba27bdb149fbe770589744e186f5 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log
+
 from neutron.agent import securitygroups_rpc
 from neutron.common import constants
 from neutron.extensions import portbindings
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_constants
 from neutron.plugins.ml2.drivers import mech_agent
 
index 2d365f13a8e65748715589f52798816eff248fc7..d70edf22fd1cb7d09c99a3bdf0a12deffaf7b7b5 100644 (file)
 
 
 from oslo_config import cfg
+from oslo_log import log
 
 from neutron.common import constants
 from neutron.extensions import portbindings
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2.drivers.mech_sriov import exceptions as exc
index 84c5ae9ad1007afaf164031b8c954629489e2f44..e6881bc422792ee68d392b679d77b1956e157d5e 100644 (file)
 
 from networking_mlnx.plugins.ml2.drivers.mlnx import constants
 from oslo_config import cfg
+from oslo_log import log
 
 from neutron.common import constants as n_const
 from neutron.extensions import portbindings
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_constants
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2.drivers import mech_agent
index 0342be3617fc8fa5732d268e1a557800d200410f..28d6931f5a1e7bd037dc6f0afbf07019ece7b03b 100644 (file)
 from networking_odl.common import constants as odl_const
 from networking_odl.ml2 import mech_driver
 from oslo_config import cfg
+from oslo_log import log
 
 from neutron.common import constants as n_const
 from neutron.extensions import portbindings
-from neutron.openstack.common import log
 from neutron.plugins.common import constants
 from neutron.plugins.ml2 import driver_api as api
 
index 21aaa5731cb0e7448f6e50dcd2c922c23c4f1fd1..73670daad5ce50b65701afc52a4c7a078a2ac20c 100644 (file)
 
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log
 import sqlalchemy as sa
 
 from neutron.common import exceptions as exc
 from neutron.db import model_base
 from neutron.i18n import _LI, _LW
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.ml2 import driver_api as api
 
index 9a426284b414b617ccc00c3c12f8e4e916b5766c..b5daeaa9e1ea58d4020494f749e913fad7d3ae2e 100644 (file)
@@ -15,6 +15,7 @@
 
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log
 from six import moves
 import sqlalchemy as sa
 from sqlalchemy import sql
@@ -23,7 +24,6 @@ from neutron.common import exceptions as n_exc
 from neutron.db import api as db_api
 from neutron.db import model_base
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.ml2.drivers import type_tunnel
 
index f935cc09aa5c05cbe6ae6129017051f28860356a..d07b321b44c95e15ecaf7f3c91675af5c0be5016 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log
+
 from neutron.common import exceptions as exc
 from neutron.i18n import _LI
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.ml2 import driver_api as api
 
index 25472438ac48f24358e1b0554efaddecdcb05353..eca978f913af09044bf9e7d999d469fda7c90dd9 100644 (file)
 #    under the License.
 import abc
 
+from oslo_log import log
+
 from neutron.common import exceptions as exc
 from neutron.common import topics
 from neutron.i18n import _LI, _LW
-from neutron.openstack.common import log
 from neutron.plugins.common import utils as plugin_utils
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2.drivers import helpers
index a2bf98a1fea8ed77f2dc103eb6f411440b8f5893..bb3aafb7ad1ab8d96ec7d724ed93d3134e1319d6 100644 (file)
@@ -16,6 +16,7 @@
 import sys
 
 from oslo_config import cfg
+from oslo_log import log
 from six import moves
 import sqlalchemy as sa
 
@@ -25,7 +26,6 @@ from neutron.common import utils
 from neutron.db import api as db_api
 from neutron.db import model_base
 from neutron.i18n import _LE, _LI, _LW
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.common import utils as plugin_utils
 from neutron.plugins.ml2 import driver_api as api
index d9c631f2f76e4bd8c9673f42c4e1499c110c5a75..39f60e061e62a7d58f91c94246a67a6f96a765a8 100644 (file)
@@ -15,6 +15,7 @@
 
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log
 from six import moves
 import sqlalchemy as sa
 from sqlalchemy import sql
@@ -23,7 +24,6 @@ from neutron.common import exceptions as n_exc
 from neutron.db import api as db_api
 from neutron.db import model_base
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.ml2.drivers import type_tunnel
 
index 4fc271d5ef61f483e83f5a4e247bdfea7a2466a4..65cfadadf259c6770bfd8afc9b792fa74ea6108e 100644 (file)
@@ -14,6 +14,7 @@
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log
 import stevedore
 
 from neutron.api.v2 import attributes
@@ -22,7 +23,6 @@ from neutron.extensions import multiprovidernet as mpnet
 from neutron.extensions import portbindings
 from neutron.extensions import providernet as provider
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log
 from neutron.plugins.ml2.common import exceptions as ml2_exc
 from neutron.plugins.ml2 import db
 from neutron.plugins.ml2 import driver_api as api
index d9108e594b4b82699dd8e8d4ff347fc6a73cc891..80c0f053a43796dbc6c67069ff4428a9d687c676 100644 (file)
 #    under the License.
 
 import contextlib
-from eventlet import greenthread
 
+from eventlet import greenthread
 from oslo_concurrency import lockutils
 from oslo_config import cfg
 from oslo_db import exception as os_db_exception
+from oslo_log import log
 from oslo_serialization import jsonutils
 from oslo_utils import excutils
 from oslo_utils import importutils
@@ -55,7 +56,6 @@ from neutron.extensions import portbindings
 from neutron.extensions import providernet as provider
 from neutron.i18n import _LE, _LI, _LW
 from neutron import manager
-from neutron.openstack.common import log
 from neutron.openstack.common import uuidutils
 from neutron.plugins.common import constants as service_constants
 from neutron.plugins.ml2.common import exceptions as ml2_exc
index c92e5474046924e811d1a660544d222b0d3fb6bb..8e1a55d9c76e1cdf6f4a0604a04ee5984eefe406 100644 (file)
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log
 import oslo_messaging
 from sqlalchemy.orm import exc
 
@@ -26,7 +27,6 @@ from neutron.common import utils
 from neutron.extensions import portbindings
 from neutron.i18n import _LW
 from neutron import manager
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as service_constants
 from neutron.plugins.ml2 import driver_api as api
 from neutron.plugins.ml2.drivers import type_tunnel
index 19c610640fe6d604c096d7be2928cefeecc6d769..688d7bebf2019caeccd0688f623c23fa052a0d38 100644 (file)
@@ -18,11 +18,11 @@ import sys
 
 from networking_mlnx.plugins.mlnx.agent import mlnx_eswitch_neutron_agent
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.i18n import _LE, _LI
 from neutron.common import config as common_config
 from neutron.common import utils
-from neutron.openstack.common import log as logging
 from neutron.plugins.mlnx.agent import config  # noqa
 
 LOG = logging.getLogger(__name__)
index 0c8f02559eaa7bed4f920f01040a021fb3da53ce..5098a47fda030e59870f9d577ddc75f86c9c3ea2 100644 (file)
@@ -12,8 +12,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
+
 from neutron.api.v2 import attributes
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 26c0685e867083324d79bb3c5a2af5c5bb1a8ad5..63dbae439a2ba1de6d6e87ee86acb5eae776918d 100644 (file)
@@ -21,6 +21,7 @@ import time
 import eventlet
 eventlet.monkey_patch()
 
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.agent.linux import ovs_lib
@@ -31,7 +32,6 @@ from neutron.common import topics
 from neutron import context as n_context
 from neutron.extensions import securitygroup as ext_sg
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.oneconvergence.lib import config
 
 LOG = logging.getLogger(__name__)
index ba6033a4154b1b3ca8520ca214b0ac8abe034825..84cc6ac8ebede34ccc25a9ad2a0bfcb4fa56e7ef 100644 (file)
 
 """Intermidiate NVSD Library."""
 
+from oslo_log import log as logging
 from oslo_serialization import jsonutils
 from oslo_utils import excutils
 
-from neutron.openstack.common import log as logging
 import neutron.plugins.oneconvergence.lib.exception as nvsdexception
 from neutron.plugins.oneconvergence.lib import plugin_helper
 
index 7b5ef69f7b78829669f0a6fb5f94b5e030257041..58b94797cfc120af1c1721ebff9e308594a08794 100644 (file)
@@ -18,12 +18,12 @@ import httplib
 import time
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_serialization import jsonutils
 import requests
 from six.moves.urllib import parse
 
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log as logging
 import neutron.plugins.oneconvergence.lib.exception as exception
 
 LOG = logging.getLogger(__name__)
index 8d7c9fb267557f6a973bd5736fb479bc4d2f2e63..af6b5c1a6bdeca3af601c102b6931dba6e941c96 100644 (file)
@@ -15,6 +15,7 @@
 """Implementation of OneConvergence Neutron Plugin."""
 
 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
@@ -42,7 +43,6 @@ from neutron.db import quota_db  # noqa
 from neutron.db import securitygroups_rpc_base as sg_db_rpc
 from neutron.extensions import portbindings
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as svc_constants
 import neutron.plugins.oneconvergence.lib.config  # noqa
 import neutron.plugins.oneconvergence.lib.exception as nvsdexception
index 36fb9d016b23030edfe00f3d88f7c60e7507abce..50baba608673159bb97ca61f0f4fd31b990ebbd0 100644 (file)
@@ -14,6 +14,7 @@
 #
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_serialization import jsonutils
 import requests
 
@@ -24,7 +25,6 @@ from neutron.extensions import external_net
 from neutron.extensions import portbindings
 from neutron.extensions import securitygroup
 from neutron import neutron_plugin_base_v2
-from neutron.openstack.common import log as logging
 from neutron.plugins.opencontrail.common import exceptions as c_exc
 
 
index f459902bee8a549cf83346f35bde325ac5cfbd1f..10bb956802f16a646e6d96d95fdb2f90d8417c57 100644 (file)
@@ -13,7 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import excutils
 
@@ -21,7 +21,6 @@ from neutron.api.rpc.handlers import dvr_rpc
 from neutron.common import constants as n_const
 from neutron.common import utils as n_utils
 from neutron.i18n import _LE, _LI, _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.openvswitch.common import constants
 
index ab479b5c5fb088dec264bb5f5342d538af4e0f0e..ecb600c56491c77460a6f088dcdef4164a4cedcb 100644 (file)
@@ -23,8 +23,8 @@ import eventlet
 eventlet.monkey_patch()
 
 import netaddr
-from neutron.plugins.openvswitch.agent import ovs_dvr_neutron_agent
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from six import moves
 
@@ -44,9 +44,9 @@ from neutron.common import topics
 from neutron.common import utils as q_utils
 from neutron import context
 from neutron.i18n import _LE, _LI, _LW
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 from neutron.plugins.common import constants as p_const
+from neutron.plugins.openvswitch.agent import ovs_dvr_neutron_agent
 from neutron.plugins.openvswitch.common import constants
 
 
index 0397ffb005817a350d5dd77dfe9da4d55e61ee20..82b8a72c7696949ae699ef7c4378c5f10f0ffe26 100644 (file)
@@ -17,8 +17,9 @@ import glob
 import os
 import re
 
+from oslo_log import log as logging
+
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.sriovnicagent.common import exceptions as exc
 from neutron.plugins.sriovnicagent import pci_lib
 
index e8b1df7917240d80a7a42c93618afaed680203d5..545769fdaa58157099ae314bb5de0563657bf914 100644 (file)
 
 import re
 
+from oslo_log import log as logging
+
 from neutron.agent.linux import ip_lib
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.sriovnicagent.common import exceptions as exc
 
 LOG = logging.getLogger(__name__)
index 7928417bb24e0475ff6ea74408ac921f8c33f566..7bb92c063f98828bf93959e92c66e02651313e34 100644 (file)
@@ -22,6 +22,7 @@ import eventlet
 eventlet.monkey_patch()
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.agent import rpc as agent_rpc
@@ -32,7 +33,6 @@ from neutron.common import topics
 from neutron.common import utils as q_utils
 from neutron import context
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 from neutron.plugins.sriovnicagent.common import config  # noqa
 from neutron.plugins.sriovnicagent.common import exceptions as exc
index 8fa8a38780d64f22289c7ddd60780b3914a24d73..65503535c40081fe70b8eea29ecd940b14c6d2a6 100644 (file)
@@ -19,9 +19,10 @@ Policy engine for neutron.  Largely copied from nova.
 
 import collections
 import itertools
-import logging
+import logging as std_logging
 import re
 
+from oslo_log import log as logging
 from oslo_utils import excutils
 from oslo_utils import importutils
 
@@ -29,11 +30,10 @@ from neutron.api.v2 import attributes
 from neutron.common import constants as const
 from neutron.common import exceptions
 from neutron.i18n import _LE, _LI, _LW
-from neutron.openstack.common import log
 from neutron.openstack.common import policy
 
 
-LOG = log.getLogger(__name__)
+LOG = logging.getLogger(__name__)
 
 _ENFORCER = None
 ADMIN_CTX_POLICY = 'context_is_admin'
@@ -357,7 +357,7 @@ def _prepare_check(context, action, target):
 
 
 def log_rule_list(match_rule):
-    if LOG.isEnabledFor(logging.DEBUG):
+    if LOG.isEnabledFor(std_logging.DEBUG):
         rules = _process_rules_list([], match_rule)
         LOG.debug("Enforcing rules: %s", rules)
 
index 25c6ad2c25613158085eac5c3437dbdedfdd03af..ae718cb929979b966db5b6a0857601be1cd9eeb0 100644 (file)
 import sys
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 import webob
 
 from neutron.common import exceptions
 from neutron.i18n import _LI, _LW
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 QUOTA_DB_MODULE = 'neutron.db.quota_db'
index 09afabfa590f4bbc243fe0f211176f91cc38f4d8..d950864d1b7984b68c8e25f15049a4fd87a0239c 100644 (file)
@@ -17,13 +17,13 @@ import random
 
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 from sqlalchemy import sql
 
 from neutron.common import constants
 from neutron.db import agents_db
 from neutron.db import agentschedulers_db
 from neutron.i18n import _LI, _LW
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index d2d2b01cae831156126a6a711728fceef8440b6b..aa407056cd7d86cd56809f8b1c4c82e8a895c477 100644 (file)
@@ -19,6 +19,7 @@ import random
 
 from oslo_config import cfg
 from oslo_db import exception as db_exc
+from oslo_log import log as logging
 import six
 from sqlalchemy import sql
 
@@ -28,7 +29,6 @@ from neutron.db import l3_agentschedulers_db
 from neutron.db import l3_db
 from neutron.db import l3_hamode_db
 from neutron.i18n import _LE, _LW
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 8f286fbdb6223ec0068daec1fe3a3216f0038786..6c5bd4fe600a9542c5903ba7bd80fce4efae22bb 100755 (executable)
@@ -22,10 +22,10 @@ import sys
 
 import eventlet
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.common import config
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 from neutron import service
 
 LOG = logging.getLogger(__name__)
index be7254a817db4fc7b9bb53d7ba08be86cac77d25..448251c383a7ee3353f90c573958a89217305933 100644 (file)
@@ -19,6 +19,7 @@ import os
 import random
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_messaging import server as rpc_server
 from oslo_utils import excutils
 from oslo_utils import importutils
@@ -29,7 +30,6 @@ from neutron import context
 from neutron.db import api as session
 from neutron.i18n import _LE, _LI
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import loopingcall
 from neutron.openstack.common import service as common_service
 from neutron import wsgi
index fbca6cc0f756d5f324257b045d3c65df14259f9f..62b7e023db103acff867e9a50dbec8e2b0b3dafa 100644 (file)
@@ -13,7 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
 
 LOG = logging.getLogger(__name__)
 
index e9ed05af280438b95b4c0c807481a80377e87e01..6e906a339fab945f223144d2888bdb4b7a433df6 100644 (file)
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 
 from neutron.common import rpc as n_rpc
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 6c007a62a8b72a906e1c6a17ebfda51ea22b04b0..41af391bb12f19ed9b48189d259155acd4da9f42 100644 (file)
@@ -14,6 +14,7 @@
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 
 from neutron.agent.linux import ip_lib
@@ -21,7 +22,6 @@ from neutron.common import exceptions as nexception
 from neutron.common import topics
 from neutron import context
 from neutron.i18n import _LE
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.services.firewall.agents import firewall_agent_api as api
 from neutron.services import provider_configuration as provconf
index ba92880333d1c37e3929f91d7454f62dc328e326..1be98dc5edc3d412c2c2580d668c4490ff715f88 100644 (file)
 """Implentation of Brocade SVI service Plugin."""
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import excutils
 
 from neutron.common import constants as l3_constants
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.ml2 import db
 from neutron.plugins.ml2.drivers.brocade.db import models as brocade_db
 from neutron.plugins.ml2.drivers.brocade.nos import nosdriver as driver
index 3465eee3fad443c00175e131ff176df6d0b9b84f..583b511f05417af4ba58abd1cd778b280362ada6 100644 (file)
@@ -18,6 +18,7 @@ import threading
 from networking_arista.common import db_lib
 from networking_arista.l3Plugin import arista_l3_driver
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import excutils
 
 from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
@@ -32,7 +33,6 @@ from neutron.db import extraroute_db
 from neutron.db import l3_agentschedulers_db
 from neutron.db import l3_gwmode_db
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.plugins.ml2.driver_context import NetworkContext  # noqa
 
index aadaa8b0153e8bd594eb2e23538b978fd40e8bf4..d2e6ab53c376e6f53124e5e530caff05463d0015 100644 (file)
@@ -16,6 +16,7 @@ import sys
 import time
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import oslo_messaging
 from oslo_utils import importutils
 
@@ -29,7 +30,6 @@ from neutron.common import utils
 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
 from neutron.openstack.common import periodic_task
 from neutron.openstack.common import service
index 661fa6be463f4c564cd35fae8703b38f6a70dc11..8bdec808c73d14b110043455ebf46988a2d0eabc 100644 (file)
@@ -13,6 +13,7 @@
 # under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 import six
 
@@ -23,7 +24,6 @@ from neutron.common import constants as constants
 from neutron.common import ipv6_utils
 from neutron.common import log
 from neutron.i18n import _LI
-from neutron.openstack.common import log as logging
 from neutron.services.metering.drivers import abstract_driver
 
 
index 2d9b456e861812fb4b6ae130b7d5a3a15685efb0..5705858eeda40a767307c89c4bd732bceb59a2b3 100644 (file)
 #    under the License.
 
 from oslo_config import cfg
+from oslo_log import log as logging
 import stevedore
 
 from neutron.common import exceptions as n_exc
 from neutron.common import repos
 from neutron.i18n import _LW
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 
 LOG = logging.getLogger(__name__)
index 2a6225a0033a5702535e73f930a3f2f5751c4ab1..0cc8b3bdae145218d5abef2f853019642f3f92b6 100644 (file)
@@ -15,6 +15,7 @@
 
 import abc
 
+from oslo_log import log as logging
 from oslo_utils import excutils
 from oslo_utils import importutils
 import six
@@ -22,7 +23,6 @@ import six
 from neutron.api import extensions
 from neutron.db import servicetype_db as sdb
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.services import provider_configuration as pconf
 
 LOG = logging.getLogger(__name__)
index 6ecaf7b4fb3ebae9073bca3640c1639f22f7b89f..323ee9185eedf05d628620942d87558598930da1 100644 (file)
@@ -13,7 +13,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
+
 from neutron.tests.tempest.common import cred_provider
 from neutron.tests.tempest import config
 from neutron.tests.tempest import manager
index bacb51bd7d4543cae9c37a892bf9fe4222b3cec4..b87ce52378e4d343b76bd6a453b0da3f2a0a625a 100644 (file)
@@ -17,13 +17,13 @@ import collections
 
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 
 from neutron.agent.common import config
 from neutron.agent.linux import interface
 from neutron.agent.linux import ip_lib
 from neutron.common import utils
-from neutron.openstack.common import log as logging
 from neutron.tests.functional.agent.linux import base
 
 LOG = logging.getLogger(__name__)
index f8569370bbb54db47cbc0dff5445117e15984603..7b23a8acf046001c99b1cce295fcdf1e818eaa3a 100755 (executable)
@@ -19,6 +19,7 @@ import functools
 import mock
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 import testtools
 import webob
 import webob.dec
@@ -38,7 +39,6 @@ from neutron.agent.metadata import agent as metadata_agent
 from neutron.common import config as common_config
 from neutron.common import constants as l3_constants
 from neutron.common import utils as common_utils
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.services import advanced_service as adv_svc
 from neutron.tests.functional.agent.linux import base
@@ -61,10 +61,7 @@ class L3AgentTestFramework(base.BaseOVSLinuxTestCase):
         config = cfg.ConfigOpts()
         config.register_opts(common_config.core_opts)
         config.register_opts(common_config.core_cli_opts)
-        config.register_cli_opts(logging.common_cli_opts)
-        config.register_cli_opts(logging.logging_cli_opts)
-        config.register_opts(logging.generic_log_opts)
-        config.register_opts(logging.log_opts)
+        logging.register_options(config)
         agent_config.register_process_monitor_opts(config)
         return config
 
index b2c2e97617fe5a608a4bf560ffc2e5b50369f092..65fed5881f10c16d476d3399171941884431a688 100644 (file)
 #    under the License.
 
 import netaddr
+from oslo_log import log as logging
 from tempest_lib import exceptions as lib_exc
 
 from neutron.tests.api.contrib import clients
 from neutron.tests.tempest.common.utils import data_utils
 from neutron.tests.tempest import config
 from neutron.tests.tempest import exceptions
-from neutron.openstack.common import log as logging
 import neutron.tests.tempest.test
 
 CONF = config.CONF
index 63d5eab47dc587cd2d8da28a67101bb5ac34546d..15cc9b0100abec2157d481df854b0163879f1999 100644 (file)
 # License for the specific language governing permissions and limitations
 # under the License.
 
+from oslo_log import log as logging
+
 from neutron.tests.tempest.api.network import base
 from neutron.tests.tempest.common.utils import data_utils
-from neutron.openstack.common import log as logging
 from neutron.tests.tempest import test
 
 
index ceee2658082a073e6e411f1bb477457299bbba9a..8d64b87b86c0b81b22cf314ac3a2addd26487179 100644 (file)
@@ -20,9 +20,9 @@ import exceptions
 import re
 import urlparse
 
+from oslo_log import log as logging
 import six
 
-from neutron.openstack.common import log as logging
 from neutron.tests.tempest.services.identity.v2.json import token_client as json_v2id
 from neutron.tests.tempest.services.identity.v3.json import token_client as json_v3id
 
index 2cb8ceced346cc26404de7f3f874118f7b26fca0..e10817bb528124dca8efe3a19b04ec0f53ce546e 100644 (file)
 import hashlib
 import os
 
+from oslo_concurrency import lockutils
+from oslo_log import log as logging
 import yaml
 
 from neutron.tests.tempest.common import cred_provider
 from neutron.tests.tempest import config
 from neutron.tests.tempest import exceptions
-from oslo_concurrency import lockutils
-from neutron.openstack.common import log as logging
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
index f132e8627a8e32be9fd6d4420b928c108f8a0a16..392c9d06503d9b6c3d67c27d2c6f0d22a2e8b88b 100644 (file)
@@ -15,7 +15,7 @@
 import shlex
 import subprocess
 
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
 
 LOG = logging.getLogger(__name__)
 
index a999cfc1c8d680de134e69917400497ee59b1666..fda955c1e8eaa37146696554dc00621f61922570 100644 (file)
 
 import abc
 
+from oslo_log import log as logging
 import six
 
 from neutron.tests.tempest import auth
 from neutron.tests.tempest import config
 from neutron.tests.tempest import exceptions
-from neutron.openstack.common import log as logging
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
index 2771823d414c90a79f06529664ea0b0a1c3e34c7..d3cae264c2a1d5f7bcfdb411801fbba4e57e612c 100644 (file)
@@ -17,8 +17,7 @@ import copy
 import functools
 
 import jsonschema
-
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 704d9fb1ba231d9e1539a438a71ba894bb34f859..ba8884f1e894f2770f217abcda2ca442dcd55551 100644 (file)
 
 import copy
 
+from oslo_log import log as logging
+
 import neutron.tests.tempest.common.generator.base_generator as base
 import neutron.tests.tempest.common.generator.valid_generator as valid
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index 4d1906e5476eabbe30c3134cbb3753d48748d5f5..8ff9259bdceefbbf122efc0231a9ee3517641c5e 100644 (file)
@@ -13,8 +13,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
+
 import neutron.tests.tempest.common.generator.base_generator as base
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index c802472fcd402b142ea62fe60a9755ce9761518c..66fc2abd4538a7633de459513a1d6a903a4e7e1d 100644 (file)
@@ -28,11 +28,11 @@ import urlparse
 
 
 import OpenSSL
+from oslo_log import log as logging
 from six import moves
 from tempest_lib import exceptions as lib_exc
 
 from neutron.tests.tempest import exceptions as exc
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 USER_AGENT = 'tempest'
index 41d7390bc04725344fa35edc16eb8417ae48b683..e4b0b0803e6b7e95d8b8a0c5473897fdf21988b6 100644 (file)
@@ -13,6 +13,7 @@
 #    under the License.
 
 import netaddr
+from oslo_log import log as logging
 from tempest_lib import exceptions as lib_exc
 
 from neutron.tests.api.contrib import clients
@@ -20,7 +21,6 @@ from neutron.tests.tempest.common import cred_provider
 from neutron.tests.tempest.common.utils import data_utils
 from neutron.tests.tempest import config
 from neutron.tests.tempest import exceptions
-from neutron.openstack.common import log as logging
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
index de1ad886dfbabbef9534ee3eb9565565b6973d54..00febc6295c2b930aafe3938ab636e26fcb22ea2 100644 (file)
@@ -20,10 +20,10 @@ import socket
 import time
 import warnings
 
+from oslo_log import log as logging
 import six
 
 from neutron.tests.tempest import exceptions
-from neutron.openstack.common import log as logging
 
 
 with warnings.catch_warnings():
index cc0004d5c4434cf6587559445fcf69f0cb8440ee..b97dd8627a97c02b82c2baaf772174ff09734772 100644 (file)
@@ -16,7 +16,7 @@
 import inspect
 import re
 
-from neutron.openstack.common import log as logging
+from oslo_log import log as logging
 
 LOG = logging.getLogger(__name__)
 
index b54ef7337030fdf8e62a71a7dcb9c08ee986d454..049d5ca925f707f6307a92cb9d7f756735999ba2 100644 (file)
 
 import time
 
+from oslo_log import log as logging
+
 from neutron.tests.tempest.common.utils import misc as misc_utils
 from neutron.tests.tempest import config
 from neutron.tests.tempest import exceptions
-from neutron.openstack.common import log as logging
 
 CONF = config.CONF
 LOG = logging.getLogger(__name__)
index deab8906692dac93b3a772e8327e7b77dfe1bcb0..569fc4b9b75318f21fa85b3bff190e6f8e2d2bce 100644 (file)
@@ -18,10 +18,9 @@ from __future__ import print_function
 import logging as std_logging
 import os
 
-from oslo.config import cfg
-
 from oslo_concurrency import lockutils
-from neutron.openstack.common import log as logging
+from oslo_config import cfg
+from oslo_log import log as logging
 
 
 def register_opt_group(conf, opt_group, options):
@@ -1099,6 +1098,8 @@ def register_opts():
         register_opt_group(cfg.CONF, g, o)
 
 
+# TODO(ihrachys): this function should probably be removed since it's not used
+# anywhere, and accesses internal implementation details of olso libraries
 def list_opts():
     """Return a list of oslo.config options available.
 
@@ -1197,7 +1198,7 @@ class TempestConfigPrivate(object):
             cfg.CONF([], project='tempest', default_config_files=config_files)
         else:
             cfg.CONF([], project='tempest')
-        logging.setup('tempest')
+        logging.setup(cfg.CONF, 'tempest')
         LOG = logging.getLogger('tempest')
         LOG.info("Using tempest config file %s" % path)
         register_opts()
@@ -1218,6 +1219,8 @@ class TempestConfigProxy(object):
 
     def _fix_log_levels(self):
         """Tweak the oslo log defaults."""
+        # TODO(ihrachys): this code accesses internal details of oslo.log
+        # library (and does it wrong), hence should be fixed
         for opt in logging.log_opts:
             if opt.dest == 'default_log_levels':
                 opt.default.extend(self._extra_log_defaults)
index 27975b345766d395be9c129163d02237b4fdff90..11ea90fef566da19352992d07545eeed55bb7a68 100644 (file)
@@ -24,6 +24,8 @@ import urllib
 import uuid
 
 import fixtures
+from oslo_log import log as logging
+from oslo_utils import importutils
 import six
 import testscenarios
 import testtools
@@ -33,8 +35,6 @@ from neutron.tests.tempest.common import credentials
 import neutron.tests.tempest.common.generator.valid_generator as valid
 from neutron.tests.tempest import config
 from neutron.tests.tempest import exceptions
-from oslo_utils import importutils
-from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
index b332d4a957b12601506dcbb037fd475b6b1ea680..8997497a6d66fd3d0064fd514d9cfe55b74e0a14 100644 (file)
@@ -15,8 +15,9 @@
 
 """stubs.py provides interface methods for the database test cases"""
 
+from oslo_log import log as logging
+
 from neutron.db import api as db
-from neutron.openstack.common import log as logging
 
 
 LOG = logging.getLogger(__name__)
index 4d14416c692241203081f6e06996ba8502f43a34..b87ad18bcb616c76ec7aa811b6070d1003ecb3ce 100644 (file)
@@ -20,7 +20,6 @@ class HackingTestCase(base.BaseTestCase):
 
     def test_log_translations(self):
         expected_marks = {
-            'audit': '_',
             'error': '_LE',
             'info': '_LI',
             'warn': '_LW',
index b939663bc2188d8cf54678f5d616f8d829e4cb45..85119008c0d8334bf9ad970f8b2d7707dacaccc5 100644 (file)
 import mock
 from oslo_config import cfg
 from oslo_context import context as oslo_context
+from oslo_log import log as logging
 from oslo_utils import importutils
 
 from neutron.db import api as db
-from neutron.openstack.common import log as logging
 from neutron.tests.unit import test_l3_plugin
 
 LOG = logging.getLogger(__name__)
index b2969ab4cd08dfb3c331f2669ac62aa8e85e1e58..cbb1df6ad6d7f63ed18acb62586a8327c1a8c87d 100644 (file)
@@ -14,9 +14,9 @@
 # limitations under the License.
 
 import mock
+from oslo_log import log as logging
 from oslo_utils import importutils
 
-from neutron.openstack.common import log as logging
 from neutron.plugins.ml2 import config as ml2_config
 from neutron.plugins.ml2.drivers.brocade import (mechanism_brocade
                                                  as brocademechanism)
index 9a66e0bdb488ac9de9d803a7904dbb5998c81baf..4aeca4e4daf62ec2b8b9605fc2e96e273a30eed5 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo_log import log as logging
+
 from neutron.agent import securitygroups_rpc
 from neutron.common import constants
 from neutron.extensions import portbindings
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_constants
 from neutron.plugins.ml2.drivers import mech_agent
 
-LOG = log.getLogger(__name__)
+LOG = logging.getLogger(__name__)
 
 
 class FakeAgentMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
index da4edbb981f67de1ad579bd1c8b5fc9bf6973dfc..48b24d5818168ba06ffadac3058a491cb8b81c61 100644 (file)
@@ -13,7 +13,8 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from neutron.openstack.common import log
+from oslo_log import log
+
 from neutron.plugins.ml2 import driver_api as api
 
 LOG = log.getLogger(__name__)
index 03463d35d18ccf53a42cb9bc4e234b9b93787237..4b33bd7247ba6c5e103f1d49d0dd6316e24af979 100644 (file)
@@ -19,6 +19,7 @@ import time
 import mock
 import netaddr
 from oslo_config import cfg
+from oslo_log import log
 import testtools
 
 from neutron.agent.linux import async_process
@@ -26,7 +27,6 @@ from neutron.agent.linux import ip_lib
 from neutron.agent.linux import ovs_lib
 from neutron.agent.linux import utils
 from neutron.common import constants as n_const
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc
 from neutron.plugins.openvswitch.agent import ovs_neutron_agent
@@ -1004,7 +1004,7 @@ class TestOvsNeutronAgent(base.BaseTestCase):
 
         with contextlib.nested(
             mock.patch.object(async_process.AsyncProcess, "_spawn"),
-            mock.patch.object(log.ContextAdapter, 'exception'),
+            mock.patch.object(log.KeywordArgumentAdapter, 'exception'),
             mock.patch.object(ovs_neutron_agent.OVSNeutronAgent,
                               'scan_ports'),
             mock.patch.object(ovs_neutron_agent.OVSNeutronAgent,
index af89685ff4006559efeeb64e1277589409c39c3b..c2fe7db5951385ca9a37c4acc9fd89283fe167ec 100644 (file)
@@ -19,10 +19,10 @@ import time
 
 import mock
 from oslo_config import cfg
+from oslo_log import log
 
 from neutron.agent.linux import ip_lib
 from neutron.agent.linux import ovs_lib
-from neutron.openstack.common import log
 from neutron.plugins.common import constants as p_const
 from neutron.plugins.openvswitch.agent import ovs_neutron_agent
 from neutron.plugins.openvswitch.common import constants
@@ -514,7 +514,7 @@ class TunnelTest(base.BaseTestCase):
         ]
 
         with contextlib.nested(
-            mock.patch.object(log.ContextAdapter, 'exception'),
+            mock.patch.object(log.KeywordArgumentAdapter, 'exception'),
             mock.patch.object(ovs_neutron_agent.OVSNeutronAgent,
                               'scan_ports'),
             mock.patch.object(ovs_neutron_agent.OVSNeutronAgent,
index b56af9e189602f1005aca7cb1f6a8fe1f4c0e6ef..af925208b4c3be0b744b3884d3547b7c1c7e8ee9 100644 (file)
@@ -17,6 +17,7 @@ import copy
 import time
 
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import timeutils
 from webob import exc
 
@@ -27,7 +28,6 @@ from neutron import context
 from neutron.db import agents_db
 from neutron.db import db_base_plugin_v2
 from neutron.extensions import agent
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.tests.unit import test_api_v2
 from neutron.tests.unit import test_db_plugin
index 9f03e38d5196be9c946e9e082d5ca9a5dd0499cb..6cb0f1fb9d4ff6b9d418bae610488d4c7ddc0112 100644 (file)
@@ -17,6 +17,7 @@ import contextlib
 import itertools
 
 import mock
+from oslo_log import log as logging
 import testtools
 from webob import exc
 
@@ -24,7 +25,6 @@ from neutron import context
 from neutron.db import models_v2
 from neutron.extensions import external_net as external_net
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.tests.unit import test_api_v2
 from neutron.tests.unit import test_db_plugin
index ea9b60d58688107ff8c829e28f51495fe63f7707..03fe2a377f0fcdb863328d691cddbb67b0b5677a 100644 (file)
 # limitations under the License.
 
 import copy
+
+from oslo_log import log as logging
 import webob.exc
 
 from neutron.db import db_base_plugin_v2
 from neutron.db import extradhcpopt_db as edo_db
 from neutron.extensions import extra_dhcp_opt as edo_ext
-from neutron.openstack.common import log as logging
 from neutron.tests.unit import test_db_plugin
 
 LOG = logging.getLogger(__name__)
index b3daa19323faf9e89dbdd71e4eb9f9b3251f1d95..ece89c0662f7c6306d9eb85ba8bc233ffde03487 100644 (file)
 #    under the License.
 
 import contextlib
+
 from oslo_config import cfg
+from oslo_log import log as logging
 from webob import exc
 
 from neutron.common import constants
 from neutron.db import extraroute_db
 from neutron.extensions import extraroute
 from neutron.extensions import l3
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.tests.unit import test_api_v2
 from neutron.tests.unit import test_l3_plugin as test_l3
index 8cef68933afead3d2880c6fa0f65380af5240d34..e1407299334cfe67e852fcd12f8d0a57e949ae4e 100644 (file)
@@ -16,6 +16,7 @@
 import abc
 
 import mock
+from oslo_log import log as logging
 from oslo_serialization import jsonutils
 import routes
 import webob
@@ -25,7 +26,6 @@ from neutron.api import extensions
 from neutron.common import config
 from neutron.common import exceptions
 from neutron.db import db_base_plugin_v2
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.tests import base
 from neutron.tests.unit import extension_stubs as ext_stubs
index bb7272d83e2d1dd9f7dd8c71d578b2fd35ad02bd..026f4e649e6bc60cbf085689437b881b7b1676ac 100644 (file)
 
 import contextlib
 import copy
-import eventlet
 
+import eventlet
 import mock
 import netaddr
+from oslo_log import log
 import oslo_messaging
 from testtools import matchers
 
@@ -40,7 +41,6 @@ from neutron.common import config as base_config
 from neutron.common import constants as l3_constants
 from neutron.common import exceptions as n_exc
 from neutron.i18n import _LE
-from neutron.openstack.common import log
 from neutron.openstack.common import uuidutils
 from neutron.plugins.common import constants as p_const
 from neutron.tests import base
@@ -179,8 +179,7 @@ class BasicRouterOperationsFramework(base.BaseTestCase):
         super(BasicRouterOperationsFramework, self).setUp()
         self.conf = agent_config.setup_conf()
         self.conf.register_opts(base_config.core_opts)
-        self.conf.register_cli_opts(log.common_cli_opts)
-        self.conf.register_cli_opts(log.logging_cli_opts)
+        log.register_options(self.conf)
         self.conf.register_opts(l3_config.OPTS)
         self.conf.register_opts(ha.OPTS)
         agent_config.register_interface_driver_opts_helper(self.conf)
index 5766ff46a9f1bbba5bb74b7ba78e5a7e8287f799..7bf9e6f10d27faa2eabf5fae4f66f7387fb61fd3 100644 (file)
@@ -20,6 +20,7 @@ import copy
 import mock
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 from oslo_utils import importutils
 from webob import exc
 
@@ -42,7 +43,6 @@ from neutron.extensions import external_net
 from neutron.extensions import l3
 from neutron.extensions import portbindings
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import uuidutils
 from neutron.plugins.common import constants as service_constants
 from neutron.tests import base
index 779bd7108e7b14bd33f2322026d4840ef5555802..62de4ef92695446a3e7229083d43af3b09a86749 100644 (file)
@@ -18,6 +18,7 @@ import os
 import mock
 import netaddr
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron.agent.common import config
 from neutron.agent.dhcp import config as dhcp_config
@@ -25,7 +26,6 @@ from neutron.agent.linux import dhcp
 from neutron.agent.linux import external_process
 from neutron.common import config as base_config
 from neutron.common import constants
-from neutron.openstack.common import log as logging
 from neutron.tests import base
 
 LOG = logging.getLogger(__name__)
index c04f5d7ee7646fff8b81860e4637508b789a7eb8..3af92997dc6c0589b4a031ff08b7974a1b4cedf5 100644 (file)
 #    under the License.
 
 import mock
+from oslo_context import context as oslo_context
 from testtools import matchers
 
 from neutron import context
-from neutron.openstack.common import local
 from neutron.tests import base
 
 
@@ -129,23 +129,26 @@ class TestNeutronContext(base.BaseTestCase):
 
     def test_neutron_context_overwrite(self):
         ctx1 = context.Context('user_id', 'tenant_id')
-        self.assertEqual(ctx1.request_id, local.store.context.request_id)
+        self.assertEqual(ctx1.request_id,
+                         oslo_context.get_current().request_id)
 
         # If overwrite is not specified, request_id should be updated.
         ctx2 = context.Context('user_id', 'tenant_id')
         self.assertNotEqual(ctx2.request_id, ctx1.request_id)
-        self.assertEqual(ctx2.request_id, local.store.context.request_id)
+        self.assertEqual(ctx2.request_id,
+                         oslo_context.get_current().request_id)
 
         # If overwrite is specified, request_id should be kept.
         ctx3 = context.Context('user_id', 'tenant_id', overwrite=False)
         self.assertNotEqual(ctx3.request_id, ctx2.request_id)
-        self.assertEqual(ctx2.request_id, local.store.context.request_id)
+        self.assertEqual(ctx2.request_id,
+                         oslo_context.get_current().request_id)
 
     def test_neutron_context_get_admin_context_not_update_local_store(self):
         ctx = context.Context('user_id', 'tenant_id')
-        req_id_before = local.store.context.request_id
+        req_id_before = oslo_context.get_current().request_id
         self.assertEqual(ctx.request_id, req_id_before)
 
         ctx_admin = context.get_admin_context()
-        self.assertEqual(req_id_before, local.store.context.request_id)
+        self.assertEqual(req_id_before, oslo_context.get_current().request_id)
         self.assertNotEqual(req_id_before, ctx_admin.request_id)
index 69f13eb68eac86f885fcec5edf4b0c645068715f..e86f3a0c365e43050350b19416767ff0f2c078ab 100644 (file)
 import types
 
 import fixtures
-
 from oslo_config import cfg
+from oslo_log import log as logging
 
 from neutron import manager
-from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
 from neutron.tests import base
 from neutron.tests.unit import dummy_plugin
index 38b407071d0f2b91d0b7998b46dc2897c8f2581e..da147f5c77104b4df7e6c914cd212ddd229f43f9 100644 (file)
@@ -139,7 +139,7 @@ class TestWSGIServer(base.BaseTestCase):
         server.stop()
 
     @mock.patch.object(wsgi, 'eventlet')
-    @mock.patch.object(wsgi, 'logging')
+    @mock.patch.object(wsgi, 'loggers')
     def test__run(self, logging_mock, eventlet_mock):
         server = wsgi.Server('test')
         server._run("app", "socket")
index d99cdaafc41c2669cd706ed9c57a7652a4251990..a24d3a63d90f8cbe3f47f0a91da7d9816fff13b1 100644 (file)
@@ -28,6 +28,8 @@ import time
 import eventlet.wsgi
 from oslo_config import cfg
 import oslo_i18n
+from oslo_log import log as logging
+from oslo_log import loggers
 from oslo_serialization import jsonutils
 from oslo_utils import excutils
 import routes.middleware
@@ -38,7 +40,6 @@ from neutron.common import exceptions as exception
 from neutron import context
 from neutron.db import api
 from neutron.i18n import _LE, _LI
-from neutron.openstack.common import log as logging
 from neutron.openstack.common import service as common_service
 from neutron.openstack.common import systemd
 
@@ -258,7 +259,7 @@ class Server(object):
         """Start a WSGI server in a new green thread."""
         eventlet.wsgi.server(socket, application,
                              max_size=self.num_threads,
-                             log=logging.WritableLogger(LOG),
+                             log=loggers.WritableLogger(LOG),
                              keepalive=CONF.wsgi_keep_alive,
                              socket_timeout=self.client_socket_timeout)
 
index d6cd8711ead93d529c70646b13f8eeb3fc7095fb..1793a9d3ab4fecb0929b729b4e8d327204355ed6 100644 (file)
@@ -4,8 +4,6 @@ module=cache
 module=eventlet_backdoor
 module=fileutils
 module=install_venv_common
-module=local
-module=log
 module=loopingcall
 module=middleware
 module=periodic_task
@@ -14,6 +12,7 @@ module=service
 module=systemd
 module=threadgroup
 module=uuidutils
+module=versionutils
 
 # The base module to hold the copy of openstack.common
 base=neutron