From 6e2f4efb1949db0ed32774f8b8de08f1f4aaeae1 Mon Sep 17 00:00:00 2001 From: Javeme Date: Fri, 22 Jan 2016 20:36:43 +0800 Subject: [PATCH] replace string format arguments with function parameters There are files containing string format arguments inside logging messages. Using logging function parameters should be preferred. Change-Id: Iaa15bc52d1d8832032cc46205effb49630cea494 Closes-Bug: #1321274 --- oslo_messaging/tests/functional/zmq/multiproc_utils.py | 8 ++++---- tools/simulator.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/oslo_messaging/tests/functional/zmq/multiproc_utils.py b/oslo_messaging/tests/functional/zmq/multiproc_utils.py index fb66615b6..be6f1c422 100644 --- a/oslo_messaging/tests/functional/zmq/multiproc_utils.py +++ b/oslo_messaging/tests/functional/zmq/multiproc_utils.py @@ -141,7 +141,7 @@ class Server(object): self.log_queue, self.ready)) self.process.start() - LOG.debug("Server process started: pid: %d" % self.process.pid) + LOG.debug("Server process started: pid: %d", self.process.pid) def _run_server(self, conf, url, log_queue, ready): server_configurer(log_queue) @@ -161,8 +161,8 @@ class Server(object): LOG.debug("Waiting for the stop signal ...") time.sleep(1) self.rpc_server.stop() - LOG.debug("Leaving process T:%s Pid:%d" % (str(target), - os.getpid())) + LOG.debug("Leaving process T:%s Pid:%d", (str(target), + os.getpid())) def cleanup(self): LOG.debug("Stopping server") @@ -217,7 +217,7 @@ class MutliprocTestCase(utils.SkipIfNoTransportURL): def spawn_server(self, name, wait_for_server=False, topic=None): srv = Server(self.conf, self.log_queue, self.url, name, topic) - LOG.debug("[SPAWN] %s (starting)..." % srv.name) + LOG.debug("[SPAWN] %s (starting)...", srv.name) srv.start() if wait_for_server: while not srv.ready.value: diff --git a/tools/simulator.py b/tools/simulator.py index 47d5b9184..e77a75c78 100755 --- a/tools/simulator.py +++ b/tools/simulator.py @@ -446,7 +446,7 @@ def main(): with open('./oslo_res_%s.txt' % args.server, 'a+') as f: f.write(log_msg + '\n') - LOG.info("calls finished, wait %d seconds" % args.exit_wait) + LOG.info("calls finished, wait %d seconds", args.exit_wait) time.sleep(args.exit_wait)