[master 3/3] edd: Fix some minor 'make check' complaints.

vathpela installerbot-noreply at redhat.com
Tue Oct 13 17:10:35 UTC 2015


From: Peter Jones <pjones at redhat.com>

This fixes the following warnings from http://newcutlet.install.bos.redhat.com:8080/job/blivet-master-PR/105/console :

W1201(logging-not-lazy):435,12: EddMatcher.devname_from_scsi_pci_dev:
Specify string format arguments as logging function parameters
W1201(logging-not-lazy):439,16: EddMatcher.devname_from_scsi_pci_dev:
Specify string format arguments as logging function parameters
W1201(logging-not-lazy):448,12: EddMatcher.devname_from_scsi_pci_dev:
Specify string format arguments as logging function parameters

Signed-off-by: Peter Jones <pjones at redhat.com>
---
 blivet/devicelibs/edd.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py
index 7018a82..7d43bac 100644
--- a/blivet/devicelibs/edd.py
+++ b/blivet/devicelibs/edd.py
@@ -432,11 +432,11 @@ def devname_from_scsi_pci_dev(self):
                                 block_entries[0])
                 name = block_entries[0]
         elif len(matching_paths) > 1:
-            log.error("edd: Too many devices match for pci dev "\
-                        "%(pci_dev)s channel %(chan)s scsi "\
-                        "id %(dev)s lun %(lun)s: " % args)
+            log.error("edd: Too many devices match for pci dev %s channel %s "\
+                      "scsi id %s lun %s: ", self.edd.pci_dev, self.edd.channel,
+                      self.edd.scsi_id, self.edd.scsi_lun)
             for matching_path in matching_paths:
-                log.error("edd:   %s" % (matching_path,))
+                log.error("edd:   %s", matching_path)
         elif len(matching_paths) == 1 and os.path.exists(matching_paths[0]):
             block_entries = os.listdir(matching_paths[0])
             if len(block_entries) == 1:
@@ -445,9 +445,9 @@ def devname_from_scsi_pci_dev(self):
                                 block_entries[0])
                 name = block_entries[0]
         else:
-            log.warning("edd: Could not find SCSI device for pci dev "\
-                        "%(pci_dev)s channel %(chan)s scsi "\
-                        "id %(dev)s lun %(lun)s" % args)
+            log.warning("edd: Could not find SCSI device for pci dev %s "\
+                        "channel %s scsi id %s lun %s", self.edd.pci_dev,
+                        self.edd.channel, self.edd.scsi_id, self.edd.scsi_lun)
         return name
 
     def devname_from_virt_pci_dev(self):


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/d4fad175e2590e07b3b70d7db84f240f9b18bdd6


More information about the anaconda-patches mailing list