Re: [PATCH 1/2] Fix various syntax errors

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

 



Hi,

On 04/14/2010 03:50 PM, Chris Lumens wrote:
@@ -105,6 +105,7 @@ class Anaconda(object):
      @property
      def firstboot(self):
          from pykickstart.constants import FIRSTBOOT_SKIP, FIRSTBOOT_DEFAULT
+        import iutil

          if self.ksdata:
              return self.ksdata.firstboot.firstboot
@@ -220,6 +221,8 @@ class Anaconda(object):
              try:
                  from gui import InstallInterface
              except Exception, e:
+                import isys
+                from flags import flags
                  stdoutLog.error("Exception starting GUI installer: %s" %(e,))
                  # if we're not going to really go into GUI mode, we need to get
                  # back to vc1 where the text install is going to pop up.
@@ -271,6 +274,7 @@ class Anaconda(object):
              self.methodstr = methodstr

      def requiresNetworkInstall(self):
+        import isys
          fail = False
          numNetDevs = isys.getNetworkDeviceCount()

@@ -303,6 +307,7 @@ class Anaconda(object):
          self.firewall.write(self.rootPath)

          if self.ksdata:
+            import iutil
              for svc in self.ksdata.services.disabled:
                  iutil.execWithRedirect("/sbin/chkconfig",
                                         [svc, "off"],

Why don't you just import isys and iutil at the top of the file instead
of over and over again?  We don't import pyanaconda until after python
updates have been set up, so there's no need to hide them.


I initially did that but I wasn't sure that was ok as all other anaconda code
imports in that file are inside methods. But if you say it is ok -> fixed.

diff --git a/storage/devices.py b/storage/devices.py
index 5413066..84cf4c1 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2421,10 +2421,11 @@ class MDRaidArrayDevice(StorageDevice):
          # For new arrays check if we have enough members
          if (not exists and parents and
                  len(parents)<  mdraid.get_raid_min_members(self.level)):
-            raise ValueError, P_("A RAID%d set requires at least %d member",
-                                 "A RAID%d set requires at least %d members",
-                                 mdraid.get_raid_min_members(self.level)) %
-                                 self.level, mdraid.get_raid_min_members(self.level)
+            raise ValueError, P_("A RAID%d set requires at least %d member" %
+                                 (self.level, mdraid.get_raid_min_members(self.level)),
+                                 "A RAID%d set requires at least %d members" %
+                                 (self.level, mdraid.get_raid_min_members(self.level)),
+                                 mdraid.get_raid_min_members(self.level))

This isn't how most of our calls to P_ look.


Oh, good one. Fixed.

Regards,

Hans

_______________________________________________
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