From 1d6458251b9f66bff9db8d8f6bddc3b6a2b3151f Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Wed, 12 Dec 2012 04:40:46 +0100
Subject: [PATCH] Fix two logging messages in TLReplaceDisks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commit f0f8d060 (β€œShow old primary/secondary node on disk
replacement”) added two wrong uses of feedback_fn, which results in
log entries such like these:

      "log": [
        [
          7, [1351258326, 466214], "message", "Replacing disk(s) 0 for instance 'instance1.example.com'"
        ],
        [
          8, [1351258326, 749391], "Current primary node: %s", "node1"
        ],
        [
          9, [1351258326, 774829], "Current seconary node: %s", "node4"
        ],
        [
          10, [1351258329, 620410], "message", "STEP 1/6 Check device existence"
        ],

(the first and fourth are OK, the 2nd and 3rd are broken).

The API of jqueue._OpExecCallbacks.Feedback should probably be changed
to prevent such an occurrence in the future.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
---
 lib/cmdlib.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 699c20256..0fbdb0694 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -11427,8 +11427,8 @@ class TLReplaceDisks(Tasklet):
 
     feedback_fn("Replacing disk(s) %s for instance '%s'" %
                 (utils.CommaJoin(self.disks), self.instance.name))
-    feedback_fn("Current primary node: %s", self.instance.primary_node)
-    feedback_fn("Current seconary node: %s",
+    feedback_fn("Current primary node: %s" % self.instance.primary_node)
+    feedback_fn("Current seconary node: %s" %
                 utils.CommaJoin(self.instance.secondary_nodes))
 
     activate_disks = (self.instance.admin_state != constants.ADMINST_UP)
-- 
GitLab