Important RHEL5 PATCH: fix various syntax errors found by pychecker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

This patch fixes the following errors pychecker found in rhel5-branch, this
is the result of an incomplete run of pychecker on the rhel5-branch on rawhide

I'm working (waiting for download mostly) on setting up a rhel5 test install
to be able todo a hopefully complete pychecker run there.

dmraid.py:262: No global (rs) found
gui.py:803: No global (errnum) found
gui.py:803: No global (msg) found
installclasses/workstation.py:30: Invalid arguments to (setGroupSelection), got
installclasses/workstation.py:30: No global (intf) found
iscsi.py:294: No global (login) found
iw/netconfig_dialog.py:225: No global (log) found
iw/release_notes.py:132: No global (link) found
rescue.py:234: No global (time) found
text.py:280: No class attribute (passphraseentry) found
text.py:281: No class attribute (confirmentry) found
textw/grpselect_text.py:58: No class attribute (group) found
textw/network_text.py:487: Using is not , may not always work
textw/network_text.py:487: Using is not , may not always work
textw/partition_text.py:1280: No global (lvname) found
yuminstall.py:573: Variable (ksrepo) used before being set

See attachment for patch.

Regards,

Hans
This patch fixes the following errors pychecker found in rhel5-branch, this
is the result of an incomplete run of pychecker on the rhel5-branch on rawhide

I'm working (waiting for download mostly) on setting up a rhel5 test install
to be able todo a hopefully complete pychecker run there.

dmraid.py:262: No global (rs) found
gui.py:803: No global (errnum) found
gui.py:803: No global (msg) found
installclasses/workstation.py:30: Invalid arguments to (setGroupSelection), got 3, expected 2
installclasses/workstation.py:30: No global (intf) found
iscsi.py:294: No global (login) found
iw/netconfig_dialog.py:225: No global (log) found
iw/release_notes.py:132: No global (link) found
rescue.py:234: No global (time) found
text.py:280: No class attribute (passphraseentry) found
text.py:281: No class attribute (confirmentry) found
textw/grpselect_text.py:58: No class attribute (group) found
textw/network_text.py:487: Using is not , may not always work
textw/network_text.py:487: Using is not , may not always work
textw/partition_text.py:1280: No global (lvname) found
yuminstall.py:573: Variable (ksrepo) used before being set

diff --git a/dmraid.py b/dmraid.py
index 2f21480..4fb7129 100644
--- a/dmraid.py
+++ b/dmraid.py
@@ -259,7 +259,7 @@ def scanForMPath(drives):
     return reduce(lambda x,y: x + [updateName(y),], mpaths, [])
 
 def renameMPath(mpath, name):
-    cacheDrives.rename(rs, name)
+    cacheDrives.rename(mpath, name)
 
 def startMPath(mpath):
     if flags.mpath == 0:
diff --git a/gui.py b/gui.py
index e151a6f..d559d91 100755
--- a/gui.py
+++ b/gui.py
@@ -800,7 +800,7 @@ class ExceptionWindow:
                     textbuf.insert(iter, line)
 
                 exnView.set_buffer(textbuf)
-            except IOError (errnum, msg):
+            except IOError, (errnum, msg):
                 log.error("Could not read %s, skipping: %s" % (longTracebackFile, msg))
                 vbox.remove(expander)
         else:
diff --git a/installclasses/workstation.py b/installclasses/workstation.py
index c2b541b..22f626e 100644
--- a/installclasses/workstation.py
+++ b/installclasses/workstation.py
@@ -27,7 +27,7 @@ class InstallClass(personal_desktop.InstallClass):
     hidden = 1
 
     def setGroupSelection(self, anaconda):
-        personal_desktop.InstallClass.setGroupSelection(self, anaconda.backend, intf)
+        personal_desktop.InstallClass.setGroupSelection(self, anaconda.backend)
         anaconda.backend.selectGroup("emacs")
         anaconda.backend.selectGroup("gnome-software-development")
 	anaconda.backend.selectGroup("x-software-development")
diff --git a/iscsi.py b/iscsi.py
index c54191a..1dabb72 100644
--- a/iscsi.py
+++ b/iscsi.py
@@ -291,7 +291,7 @@ class iscsi(object):
 
             for pidstr in psout.split():
                 pid = string.atoi(pidstr)
-                login.info("killing %s %d" % (ISCSID, pid))
+                log.info("killing %s %d" % (ISCSID, pid))
 
                 os.kill(pid, signal.SIGKILL)
 
diff --git a/iw/netconfig_dialog.py b/iw/netconfig_dialog.py
index a3f1626..09f16de 100644
--- a/iw/netconfig_dialog.py
+++ b/iw/netconfig_dialog.py
@@ -22,6 +22,9 @@ from rhpl.translate import _, N_
 import gui
 import network
 import isys
+import logging
+
+log = logging.getLogger("anaconda")
 
 class NetworkConfigurator:
     def __init__(self, network):
diff --git a/iw/release_notes.py b/iw/release_notes.py
index 6731deb..ca7d87c 100644
--- a/iw/release_notes.py
+++ b/iw/release_notes.py
@@ -129,7 +129,7 @@ class ReleaseNotesViewer:
 				try:
 					f = self.openURI(uri)
 				except OSError:
-					self.log("Failed to open %s" % (link,))
+					self.log("Failed to open %s" % (uri,))
 					return
 
 				if f is not None:
diff --git a/rescue.py b/rescue.py
index 0edc0b1..e2dc294 100644
--- a/rescue.py
+++ b/rescue.py
@@ -27,6 +27,7 @@ import fsset
 import shutil
 import fcntl
 import termios
+import time
 
 from rhpl.translate import _
 
diff --git a/text.py b/text.py
index 2114cbc..9a6c948 100644
--- a/text.py
+++ b/text.py
@@ -277,8 +277,8 @@ class LuksPassphraseWindow:
                     continue
             else:
                 passphrase = self.passphrase
-                self.passphraseentry.set(self.passphrase)
-                self.confirmentry.set(self.passphrase)
+                passphraseentry.set(self.passphrase)
+                confirmentry.set(self.passphrase)
 
             retrofit = False
             if self.preexist:
diff --git a/textw/grpselect_text.py b/textw/grpselect_text.py
index f5ba02e..18f9587 100644
--- a/textw/grpselect_text.py
+++ b/textw/grpselect_text.py
@@ -55,7 +55,7 @@ class GroupSelectionWindow:
             pkgs = self.ayum.pkgSack.returnNewestByName(pkg)
         except yum.Errors.PackageSackError:
             log.debug("no such package %s from group %s" %
-                      (pkg, self.group.groupid))
+                      (pkg, grpid))
         if pkgs:
             pkgs = self.ayum.bestPackagesFromList(pkgs)
         for po in pkgs:
diff --git a/textw/network_text.py b/textw/network_text.py
index 76efc39..e3b84c0 100644
--- a/textw/network_text.py
+++ b/textw/network_text.py
@@ -484,7 +484,7 @@ class NetworkDeviceWindow:
                 continue
 
             # set the manual IPv6 address/prefix
-            if prefix is not '':
+            if prefix != '':
                 addr = "%s/%s" % (ip, prefix,)
             else:
                 addr = "%s" % (ip,)
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 1ce982a..723af70 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -1277,7 +1277,7 @@ class PartitionWindow:
                     self.intf.messageWindow(_("Illegal logical volume name"),
                                             _("The logical volume name \"%s\" "
                                               "is already in use. Please "
-                                              "pick another.") % (lvname,),
+                                              "pick another.") % (lvn,),
                                             custom_icon="error")
                     continue
                     
diff --git a/yuminstall.py b/yuminstall.py
index 068d452..d864c14 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -570,7 +570,7 @@ class AnacondaYum(YumSorter):
                     self.repos.add(repo)
                     log.info("added repository %s with source URL %s" % (repo.name, repo.baseurl))
                 except yum.Errors.DuplicateRepoError, e:
-                    log.warning("ignoring duplicate repository %s with source URL %s" % (ksrepo.name, ksrepo.baseurl or ksrepo.mirrorlist))
+                    log.warning("ignoring duplicate repository %s with source URL %s" % (repo.name, repo.baseurl or repo.mirrorlist))
 
         if self.anaconda.isKickstart:
             for ksrepo in self.anaconda.id.ksdata.repoList:
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux