Merge "Enforce log hints in neutron.plugins.plumgrid"

This commit is contained in:
Jenkins 2014-12-05 00:11:57 +00:00 committed by Gerrit Code Review
commit 2a2f6f06c6
4 changed files with 11 additions and 8 deletions

View File

@ -92,7 +92,7 @@ def _directory_to_check_translation(filename):
#"neutron/plugins/oneconvergence", #"neutron/plugins/oneconvergence",
"neutron/plugins/opencontrail", "neutron/plugins/opencontrail",
"neutron/plugins/openvswitch", "neutron/plugins/openvswitch",
#"neutron/plugins/plumgrid", "neutron/plugins/plumgrid",
"neutron/plugins/sriovnicagent", "neutron/plugins/sriovnicagent",
"neutron/plugins/vmware"] "neutron/plugins/vmware"]
return any([dir in filename for dir in dirs]) return any([dir in filename for dir in dirs])

View File

@ -13,6 +13,7 @@
# under the License. # under the License.
from neutron.extensions import providernet as provider from neutron.extensions import providernet as provider
from neutron.i18n import _LI
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -26,12 +27,12 @@ class Plumlib():
""" """
def __init__(self): def __init__(self):
LOG.info(_('Python PLUMgrid Fake Library Started ')) LOG.info(_LI('Python PLUMgrid Fake Library Started '))
pass pass
def director_conn(self, director_plumgrid, director_port, timeout, def director_conn(self, director_plumgrid, director_port, timeout,
director_admin, director_password): director_admin, director_password):
LOG.info(_('Fake Director: %s'), LOG.info(_LI('Fake Director: %s'),
director_plumgrid + ':' + director_port) director_plumgrid + ':' + director_port)
pass pass

View File

@ -20,6 +20,7 @@ to the PLUMgrid Network Management System called Director
from plumgridlib import plumlib from plumgridlib import plumlib
from neutron.i18n import _LI
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -32,7 +33,7 @@ class Plumlib(object):
""" """
def __init__(self): def __init__(self):
LOG.info(_('Python PLUMgrid Library Started ')) LOG.info(_LI('Python PLUMgrid Library Started '))
def director_conn(self, director_plumgrid, director_port, timeout, def director_conn(self, director_plumgrid, director_port, timeout,
director_admin, director_password): director_admin, director_password):

View File

@ -33,6 +33,7 @@ from neutron.db import quota_db # noqa
from neutron.db import securitygroups_db from neutron.db import securitygroups_db
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron.extensions import securitygroup as sec_grp from neutron.extensions import securitygroup as sec_grp
from neutron.i18n import _LI, _LW
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.plumgrid.common import exceptions as plum_excep from neutron.plugins.plumgrid.common import exceptions as plum_excep
from neutron.plugins.plumgrid.plumgrid_plugin import plugin_ver from neutron.plugins.plumgrid.plumgrid_plugin import plugin_ver
@ -70,7 +71,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2,
binding_set = "extension:port_binding:set" binding_set = "extension:port_binding:set"
def __init__(self): def __init__(self):
LOG.info(_('Neutron PLUMgrid Director: Starting Plugin')) LOG.info(_LI('Neutron PLUMgrid Director: Starting Plugin'))
super(NeutronPluginPLUMgridV2, self).__init__() super(NeutronPluginPLUMgridV2, self).__init__()
self.plumgrid_init() self.plumgrid_init()
@ -88,7 +89,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2,
plum_driver = cfg.CONF.plumgriddirector.driver plum_driver = cfg.CONF.plumgriddirector.driver
# PLUMgrid Director info validation # PLUMgrid Director info validation
LOG.info(_('Neutron PLUMgrid Director: %s'), director_plumgrid) LOG.info(_LI('Neutron PLUMgrid Director: %s'), director_plumgrid)
self._plumlib = importutils.import_object(plum_driver) self._plumlib = importutils.import_object(plum_driver)
self._plumlib.director_conn(director_plumgrid, director_port, timeout, self._plumlib.director_conn(director_plumgrid, director_port, timeout,
director_admin, director_password) director_admin, director_password)
@ -765,7 +766,7 @@ class NeutronPluginPLUMgridV2(db_base_plugin_v2.NeutronDbPluginV2,
def _network_admin_state(self, network): def _network_admin_state(self, network):
if network["network"].get("admin_state_up") is False: if network["network"].get("admin_state_up") is False:
LOG.warning(_("Networks with admin_state_up=False are not " LOG.warning(_LW("Networks with admin_state_up=False are not "
"supported by PLUMgrid plugin yet.")) "supported by PLUMgrid plugin yet."))
return network return network