Use openstack.common.logging in NEC OpenFlow plugin

Fixes bug 1084129

Also fixes non-i18n raise messages.

Change-Id: I077662329d17427fa3efa7269244248613a6ab85
This commit is contained in:
Akihiro MOTOKI 2012-11-28 22:13:42 +09:00
parent 1a44190cb4
commit 2f1048542e
7 changed files with 8 additions and 12 deletions

View File

@ -21,7 +21,6 @@
# under the License. # under the License.
# @author: Ryota MIBU # @author: Ryota MIBU
import logging
import socket import socket
import sys import sys
import time import time
@ -30,11 +29,11 @@ from quantum.agent.linux import ovs_lib
from quantum.common import config as logging_config from quantum.common import config as logging_config
from quantum.common import topics from quantum.common import topics
from quantum.openstack.common import context from quantum.openstack.common import context
from quantum.openstack.common import log as logging
from quantum.openstack.common import rpc from quantum.openstack.common import rpc
from quantum.plugins.nec.common import config from quantum.plugins.nec.common import config
logging.basicConfig()
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -17,9 +17,9 @@
import httplib import httplib
import json import json
import logging
import socket import socket
from quantum.openstack.common import log as logging
from quantum.plugins.nec.common import exceptions as nexc from quantum.plugins.nec.common import exceptions as nexc

View File

@ -15,12 +15,11 @@
# under the License. # under the License.
# @author: Ryota MIBU # @author: Ryota MIBU
import logging
import sqlalchemy as sa import sqlalchemy as sa
from quantum.db import api as db from quantum.db import api as db
from quantum.db import model_base from quantum.db import model_base
from quantum.openstack.common import log as logging
from quantum.plugins.nec.common import config from quantum.plugins.nec.common import config
from quantum.plugins.nec.common import exceptions as nexc from quantum.plugins.nec.common import exceptions as nexc
from quantum.plugins.nec.db import models as nmodels from quantum.plugins.nec.db import models as nmodels

View File

@ -15,12 +15,11 @@
# under the License. # under the License.
# @author: Ryota MIBU # @author: Ryota MIBU
import logging
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from quantum.api.v2 import attributes from quantum.api.v2 import attributes
from quantum.db import db_base_plugin_v2 from quantum.db import db_base_plugin_v2
from quantum.openstack.common import log as logging
from quantum.openstack.common import uuidutils from quantum.openstack.common import uuidutils
from quantum.plugins.nec.common import exceptions as q_exc from quantum.plugins.nec.common import exceptions as q_exc
from quantum.plugins.nec.db import models as nmodels from quantum.plugins.nec.db import models as nmodels

View File

@ -15,9 +15,8 @@
# under the License. # under the License.
# @author: Ryota MIBU # @author: Ryota MIBU
import logging
from quantum.openstack.common import importutils from quantum.openstack.common import importutils
from quantum.openstack.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -15,12 +15,11 @@
# under the License. # under the License.
# @author: Ryota MIBU # @author: Ryota MIBU
import logging
from quantum.common import topics from quantum.common import topics
from quantum import context from quantum import context
from quantum.db import dhcp_rpc_base from quantum.db import dhcp_rpc_base
from quantum.db import l3_db from quantum.db import l3_db
from quantum.openstack.common import log as logging
from quantum.openstack.common import rpc from quantum.openstack.common import rpc
from quantum.openstack.common.rpc import dispatcher from quantum.openstack.common.rpc import dispatcher
from quantum.plugins.nec.common import config from quantum.plugins.nec.common import config

View File

@ -43,7 +43,8 @@ class OFCManager(object):
model = self.resource_map[resource] model = self.resource_map[resource]
ofc_item = ndb.find_ofc_item(model, quantum_id) ofc_item = ndb.find_ofc_item(model, quantum_id)
if not ofc_item: if not ofc_item:
reason = "NotFound %s for quantum_id=%s." % (resource, quantum_id) reason = _("NotFound %(resource)s for "
"quantum_id=%(quantum_id)s.") % locals()
raise nexc.OFCConsistencyBroken(reason=reason) raise nexc.OFCConsistencyBroken(reason=reason)
return ofc_item.id return ofc_item.id