from neutron.api.v2 import attributes
from neutron.common import utils
+from neutron.openstack.common.gettextutils import _LI
from neutron.openstack.common import log as logging
from neutron import version
"""Sets up the logging options for a log with supplied name."""
product_name = "neutron"
logging.setup(product_name)
- LOG.info(_("Logging enabled!"))
+ LOG.info(_LI("Logging enabled!"))
def load_paste_app(app_name):
raise cfg.ConfigFilesNotFoundError(
config_files=[cfg.CONF.api_paste_config])
config_path = os.path.abspath(config_path)
- LOG.info(_("Config paste file: %s"), config_path)
+ LOG.info(_LI("Config paste file: %s"), config_path)
try:
app = deploy.loadapp("config:%s" % config_path, name=app_name)
try:
item = target_self._cache.get(key, self._not_cached)
except TypeError:
- LOG.debug(_("Method %(func_name)s cannot be cached due to "
- "unhashable parameters: args: %(args)s, kwargs: "
- "%(kwargs)s"),
+ LOG.debug("Method %(func_name)s cannot be cached due to "
+ "unhashable parameters: args: %(args)s, kwargs: "
+ "%(kwargs)s",
{'func_name': func_name,
'args': args,
'kwargs': kwargs})
'class': target_self.__class__.__name__})
if not target_self._cache:
if self._first_call:
- LOG.debug(_("Instance of class %(module)s.%(class)s doesn't "
- "contain attribute _cache therefore results "
- "cannot be cached for %(func_name)s."),
+ LOG.debug("Instance of class %(module)s.%(class)s doesn't "
+ "contain attribute _cache therefore results "
+ "cannot be cached for %(func_name)s.",
{'module': target_self.__module__,
'class': target_self.__class__.__name__,
'func_name': self.func.__name__})
"""
mtime = os.path.getmtime(filename)
if not cache_info or mtime != cache_info.get('mtime'):
- LOG.debug(_("Reloading cached file %s"), filename)
+ LOG.debug("Reloading cached file %s", filename)
with open(filename) as fap:
cache_info['data'] = fap.read()
cache_info['mtime'] = mtime
from neutron.agent.linux import dhcp
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
+from neutron.openstack.common.gettextutils import _LW
from neutron.openstack.common import log as logging
namespace = self._get_namespace(port)
if ip_lib.device_exists(interface_name, self.root_helper, namespace):
- LOG.debug(_('Reusing existing device: %s.'), interface_name)
+ LOG.debug('Reusing existing device: %s.', interface_name)
else:
self.driver.plug(network.id,
port.id,
try:
ip.netns.delete(namespace)
except Exception:
- LOG.warn(_('Failed to delete namespace %s'), namespace)
+ LOG.warn(_LW('Failed to delete namespace %s'), namespace)
else:
self.driver.unplug(self.driver.get_device_name(port),
bridge=bridge)
dirs = ["neutron/agent",
"neutron/api",
"neutron/cmd",
+ "neutron/common",
"neutron/db",
- "neutron/extensions"]
+ "neutron/debug",
+ "neutron/extensions",
+ "neutron/hacking",
+ "neutron/locale"]
return any([dir in filename for dir in dirs])