Merge "Don't translate debug level logs in nova.spice, storage, tests and vnc"

This commit is contained in:
Jenkins 2014-05-06 18:37:59 +00:00 committed by Gerrit Code Review
commit 6cbb6f0c64
6 changed files with 18 additions and 17 deletions

View File

@ -233,6 +233,10 @@ def no_translate_debug_logs(logical_line, filename):
"nova/pci",
"nova/rdp",
"nova/servicegroup",
"nova/spice",
"nova/storage",
"nova/tests",
"nova/vnc",
]
if max([name in filename for name in dirs]):
if logical_line.startswith("LOG.debug(_("):

View File

@ -67,8 +67,8 @@ def get_device_info(device):
def _wait_for_remove(device, tries):
tries = tries + 1
LOG.debug(_("Trying (%(tries)s) to remove device %(device)s")
% {'tries': tries, 'device': device["device"]})
LOG.debug("Trying (%(tries)s) to remove device %(device)s",
{'tries': tries, 'device': device["device"]})
path = "/sys/bus/scsi/drivers/sd/%s:%s:%s:%s/delete"
echo_scsi_command(path % (device["host"], device["channel"],
@ -121,7 +121,7 @@ def find_multipath_device(device):
LOG.warn(_("Couldn't find multipath device %s"), line)
return None
LOG.debug(_("Found multipath device = %s"), mdev)
LOG.debug("Found multipath device = %s", mdev)
device_lines = lines[3:]
for dev_line in device_lines:
if dev_line.find("policy") != -1:

View File

@ -19,7 +19,6 @@ import re
from eventlet import greenthread
import six
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.openstack.common import processutils
@ -68,7 +67,7 @@ def fake_execute(*cmd_parts, **kwargs):
run_as_root = kwargs.get('run_as_root', False)
cmd_str = ' '.join(str(part) for part in cmd_parts)
LOG.debug(_("Faking execution of cmd (subprocess): %s"), cmd_str)
LOG.debug("Faking execution of cmd (subprocess): %s", cmd_str)
_fake_execute_log.append(cmd_str)
reply_handler = fake_execute_default_reply_handler
@ -76,7 +75,7 @@ def fake_execute(*cmd_parts, **kwargs):
for fake_replier in _fake_execute_repliers:
if re.match(fake_replier[0], cmd_str):
reply_handler = fake_replier[1]
LOG.debug(_('Faked command matched %s') % fake_replier[0])
LOG.debug('Faked command matched %s', fake_replier[0])
break
if isinstance(reply_handler, six.string_types):
@ -92,11 +91,11 @@ def fake_execute(*cmd_parts, **kwargs):
run_as_root=run_as_root,
check_exit_code=check_exit_code)
except processutils.ProcessExecutionError as e:
LOG.debug(_('Faked command raised an exception %s'), e)
LOG.debug('Faked command raised an exception %s', e)
raise
LOG.debug(_("Reply to faked command is stdout='%(stdout)s' "
"stderr='%(stderr)s'") % {'stdout': reply[0], 'stderr': reply[1]})
LOG.debug("Reply to faked command is stdout='%(stdout)s' "
"stderr='%(stderr)s'", {'stdout': reply[0], 'stderr': reply[1]})
# Replicate the sleep call in the real function
greenthread.sleep(0)

View File

@ -126,7 +126,7 @@ class TestOpenStackClient(object):
headers=headers)
http_status = response.status
LOG.debug(_("%(auth_uri)s => code %(http_status)s") %
LOG.debug("%(auth_uri)s => code %(http_status)s",
{'auth_uri': auth_uri, 'http_status': http_status})
if http_status == 401:
@ -157,7 +157,7 @@ class TestOpenStackClient(object):
response = self.request(full_uri, **kwargs)
http_status = response.status
LOG.debug(_("%(relative_uri)s => code %(http_status)s") %
LOG.debug("%(relative_uri)s => code %(http_status)s",
{'relative_uri': relative_uri, 'http_status': http_status})
if check_response_status:
@ -175,7 +175,7 @@ class TestOpenStackClient(object):
def _decode_json(self, response):
body = response.read()
LOG.debug(_("Decoding JSON: %s") % (body))
LOG.debug("Decoding JSON: %s", body)
if body:
return jsonutils.loads(body)
else:

View File

@ -14,7 +14,6 @@
# under the License.
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.tests.integrated.api import client
from nova.tests.integrated import integrated_helpers
@ -30,7 +29,7 @@ class LoginTest(integrated_helpers._IntegratedTestBase):
# Simple check - we list flavors - so we know we're logged in.
flavors = self.api.get_flavors()
for flavor in flavors:
LOG.debug(_("flavor: %s") % flavor)
LOG.debug("flavor: %s", flavor)
class LoginTestV3(client.TestOpenStackClientV3Mixin, LoginTest):

View File

@ -39,7 +39,6 @@ from nova import db
from nova import exception
from nova.objects import aggregate as aggregate_obj
from nova.objects import instance as instance_obj
from nova.openstack.common.gettextutils import _
from nova.openstack.common import importutils
from nova.openstack.common import jsonutils
from nova.openstack.common import log as logging
@ -945,7 +944,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
# mount point will be the last item of the command list
self._tmpdir = cmd[len(cmd) - 1]
LOG.debug(_('Creating files in %s to simulate guest agent'),
LOG.debug('Creating files in %s to simulate guest agent',
self._tmpdir)
os.makedirs(os.path.join(self._tmpdir, 'usr', 'sbin'))
# Touch the file using open
@ -956,7 +955,7 @@ class XenAPIVMTestCase(stubs.XenAPITestBase):
def _umount_handler(cmd, *ignore_args, **ignore_kwargs):
# Umount would normall make files in the m,ounted filesystem
# disappear, so do that here
LOG.debug(_('Removing simulated guest agent files in %s'),
LOG.debug('Removing simulated guest agent files in %s',
self._tmpdir)
os.remove(os.path.join(self._tmpdir, 'usr', 'sbin',
'xe-update-networking'))