[PATCH 1/3] Code fixes of errors shown by pylint

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

 



This only fixes the serious errors that may affect F11 Beta.  There's still
a lot of patch left that fixes some more nitpicky stuff which can come in
later.
---
 storage/__init__.py          |    9 +++++----
 storage/devicelibs/lvm.py    |    1 +
 storage/devicelibs/mdraid.py |    3 +++
 storage/devicelibs/swap.py   |    2 +-
 storage/formats/mdraid.py    |    2 +-
 storage/formats/swap.py      |    4 +---
 storage/iscsi.py             |    2 +-
 7 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 557f759..3fefbb5 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -75,7 +75,7 @@ def storageInitialize(anaconda):
 
         device = storage.devicetree.resolveDevice(devspec)
         if device is None:
-            if self.getUpgrade():
+            if anaconda.id.getUpgrade():
                 return
             else:
                 anaconda.intf.messageWindow(_("Unknown Device"),
@@ -455,7 +455,7 @@ class Storage(object):
                    part.fileSystemType in ("ext3", "ext2", "fat16", "fat32"):
                     dests.append(part.path, device.name)
 
-            if not parts:
+            if not disk.partitions:
                 dests.append(device.path, device.name)
 
         return dests
@@ -647,7 +647,7 @@ class Storage(object):
                             return False
                     return True
         elif device.format.type == "swap":
-                return True
+            return True
 
         # be safe for anything else and default to off
         return False
@@ -864,7 +864,7 @@ class Storage(object):
     def writeKS(self, f):
         log.warning("Storage.writeKS not completely implemented")
         self.iscsi.writeKS(f)
-        self.zfcp.writeFS(f)
+        self.zfcp.writeKS(f)
 
 
 def getReleaseString(mountpoint):
@@ -1144,6 +1144,7 @@ class FSSet(object):
         self.devicetree = devicetree
         self.cryptTab = None
         self.blkidTab = None
+        self.origFStab = None
         self.active = False
         self._dev = None
         self._devpts = None
diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py
index 52d9315..0dedc8c 100644
--- a/storage/devicelibs/lvm.py
+++ b/storage/devicelibs/lvm.py
@@ -27,6 +27,7 @@ import re
 import iutil
 
 from ..errors import *
+from constants import *
 
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
diff --git a/storage/devicelibs/mdraid.py b/storage/devicelibs/mdraid.py
index d02b6ea..dec5f2d 100644
--- a/storage/devicelibs/mdraid.py
+++ b/storage/devicelibs/mdraid.py
@@ -28,6 +28,9 @@ from ..errors import *
 import gettext
 _ = lambda x: gettext.ldgettext("anaconda", x)
 
+import logging
+log = logging.getLogger("storage")
+
 # raidlevels constants
 RAID10 = 10
 RAID6 = 6
diff --git a/storage/devicelibs/swap.py b/storage/devicelibs/swap.py
index 38000eb..090c92e 100644
--- a/storage/devicelibs/swap.py
+++ b/storage/devicelibs/swap.py
@@ -23,7 +23,7 @@
 import resource
 
 import iutil
-import resource
+import os
 
 from ..errors import *
 
diff --git a/storage/formats/mdraid.py b/storage/formats/mdraid.py
index 0871a2a..ec1a617 100644
--- a/storage/formats/mdraid.py
+++ b/storage/formats/mdraid.py
@@ -69,7 +69,7 @@ class MDRaidMember(DeviceFormat):
         log_method_call(self, device=self.device,
                         type=self.type, status=self.status)
         if not self.exists:
-            raise MDRaidMemberError("format does not exist")
+            raise MDMemberError("format does not exist")
 
         info = mdraid.mdexamine(self.device)
         if self.uuid is None:
diff --git a/storage/formats/swap.py b/storage/formats/swap.py
index e5dd8ef..bc5dbd9 100644
--- a/storage/formats/swap.py
+++ b/storage/formats/swap.py
@@ -20,9 +20,7 @@
 # Red Hat Author(s): Dave Lehman <dlehman@xxxxxxxxxx>
 #
 
-import os
-
-from iutil import log_method_call
+from iutil import log_method_call, numeric_type
 from parted import PARTITION_SWAP
 from ..errors import *
 from ..devicelibs import swap
diff --git a/storage/iscsi.py b/storage/iscsi.py
index b9f975e..29d8983 100644
--- a/storage/iscsi.py
+++ b/storage/iscsi.py
@@ -287,7 +287,7 @@ class iscsi(object):
                     if node.name    == disk.iscsi_name and \
                        node.address == disk.iscsi_address and \
                        node.port    == disk.iscsi_port:
-                        node.setParameter("node.startup", "automatic");
+                        node.setParameter("node.startup", "automatic")
                         break
 
             if not os.path.isdir(instPath + "/etc/iscsi"):
-- 
1.6.1.3

_______________________________________________
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