[PATCH 2/2] kickstart.py: Fix undefined reference to handler

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

 



Instead of using self.handler, which is not defined for
BaseData derived classes, always use anaconda.id.ksdata in the execute()
method of pykickstart command/data derived classes.
---
 kickstart.py |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/kickstart.py b/kickstart.py
index 7665686..054a65b 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -197,7 +197,7 @@ class AutoPart(commands.autopart.F12_AutoPart):
             anaconda.id.storage.autoPartAddBackupPassphrase = \
                 self.backuppassphrase
 
-        self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
+        anaconda.ksdata.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
 
 class AutoStep(commands.autostep.FC3_AutoStep):
     def execute(self, anaconda):
@@ -298,7 +298,7 @@ class ClearPart(commands.clearpart.FC3_ClearPart):
             anaconda.id.storage.reinitializeDisks = self.initAll
 
         clearPartitions(anaconda.id.storage)
-        self.handler.skipSteps.append("cleardiskssel")
+        anaconda.ksdata.skipSteps.append("cleardiskssel")
 
 class Fcoe(commands.fcoe.F13_Fcoe):
     def parse(self, args):
@@ -356,7 +356,7 @@ class IgnoreDisk(commands.ignoredisk.F8_IgnoreDisk):
     def execute(self, anaconda):
         anaconda.id.storage.ignoredDisks = self.ignoredisk
         anaconda.id.storage.exclusiveDisks = self.onlyuse
-        self.handler.skipSteps.extend(["filter", "filtertype"])
+        anaconda.ksdata.skipSteps.extend(["filter", "filtertype"])
 
 class Iscsi(commands.iscsi.F10_Iscsi):
     def parse(self, args):
@@ -382,13 +382,13 @@ class Keyboard(commands.keyboard.FC3_Keyboard):
     def execute(self, anaconda):
         anaconda.id.keyboard.set(self.keyboard)
         anaconda.id.keyboard.beenset = 1
-        self.handler.skipSteps.append("keyboard")
+        anaconda.ksdata.skipSteps.append("keyboard")
 
 class Lang(commands.lang.FC3_Lang):
     def execute(self, anaconda):
         anaconda.id.instLanguage.instLang = self.lang
         anaconda.id.instLanguage.systemLang = self.lang
-        self.handler.skipSteps.append("language")
+        anaconda.ksdata.skipSteps.append("language")
 
 class LogVolData(commands.logvol.F12_LogVolData):
     def execute(self, anaconda):
@@ -430,7 +430,7 @@ class LogVolData(commands.logvol.F12_LogVolData):
 
             dev.format.mountpoint = self.mountpoint
             dev.format.mountopts = self.fsopts
-            self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
+            anaconda.ksdata.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
             return
 
         # Make sure this LV name is not already used in the requested VG.
@@ -511,7 +511,7 @@ class LogVolData(commands.logvol.F12_LogVolData):
                                      parents=request)
             storage.createDevice(luksdev)
 
-        self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
+        anaconda.ksdata.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
 
 class Logging(commands.logging.FC6_Logging):
     def execute(self, anaconda):
@@ -634,7 +634,7 @@ class PartitionData(commands.partition.F12_PartData):
 
             # store "raid." alias for other ks partitioning commands
             if self.onPart:
-                self.handler.onPart[kwargs["name"]] = self.onPart
+                anaconda.id.ksdata.onPart[kwargs["name"]] = self.onPart
             self.mountpoint = ""
         elif self.mountpoint.startswith("pv."):
             type = "lvmpv"
@@ -645,7 +645,7 @@ class PartitionData(commands.partition.F12_PartData):
 
             # store "pv." alias for other ks partitioning commands
             if self.onPart:
-                self.handler.onPart[kwargs["name"]] = self.onPart
+                anaconda.id.ksdata.onPart[kwargs["name"]] = self.onPart
             self.mountpoint = ""
         elif self.mountpoint == "/boot/efi":
             type = "EFI System Partition"
@@ -671,7 +671,7 @@ class PartitionData(commands.partition.F12_PartData):
 
             dev.format.mountpoint = self.mountpoint
             dev.format.mountopts = self.fsopts
-            self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
+            anaconda.ksdata.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
             return
 
         # Size specification checks.
@@ -760,11 +760,11 @@ class PartitionData(commands.partition.F12_PartData):
                                      parents=request)
             storage.createDevice(luksdev)
 
-        self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
+        anaconda.ksdata.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
 
 class Reboot(commands.reboot.FC6_Reboot):
     def execute(self, anaconda):
-        self.handler.skipSteps.append("complete")
+        anaconda.ksdata.skipSteps.append("complete")
 
 class RaidData(commands.raid.F12_RaidData):
     def execute(self, anaconda):
@@ -783,7 +783,7 @@ class RaidData(commands.raid.F12_RaidData):
         elif self.mountpoint.startswith("pv."):
             type = "lvmpv"
             kwargs["name"] = self.mountpoint
-            self.handler.onPart[kwargs["name"]] = devicename
+            anaconda.id.ksdata.onPart[kwargs["name"]] = devicename
 
             if devicetree.getDeviceByName(kwargs["name"]):
                 raise KickstartValueError, formatErrorMsg(self.lineno, msg="PV partition defined multiple times")
@@ -813,13 +813,13 @@ class RaidData(commands.raid.F12_RaidData):
 
             dev.format.mountpoint = self.mountpoint
             dev.format.mountopts = self.fsopts
-            self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
+            anaconda.ksdata.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
             return
 
         # Get a list of all the RAID members.
         for member in self.members:
             # if member is using --onpart, use original device
-            member = self.handler.onPart.get(member, member)
+            member = anaconda.id.ksdata.onPart.get(member, member)
             dev = devicetree.getDeviceByName(member)
             if not dev:
                 raise KickstartValueError, formatErrorMsg(self.lineno, msg="Tried to use undefined partition %s in RAID specification" % member)
@@ -899,14 +899,14 @@ class RaidData(commands.raid.F12_RaidData):
                                      parents=request)
             storage.createDevice(luksdev)
 
-        self.handler.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
+        anaconda.ksdata.skipSteps.extend(["partition", "zfcpconfig", "parttype"])
 
 class RootPw(commands.rootpw.F8_RootPw):
     def execute(self, anaconda):
         anaconda.id.rootPassword["password"] = self.password
         anaconda.id.rootPassword["isCrypted"] = self.isCrypted
         anaconda.id.rootPassword["lock"] = self.lock
-        self.handler.skipSteps.append("accounts")
+        anaconda.ksdata.skipSteps.append("accounts")
 
 class SELinux(commands.selinux.FC3_SELinux):
     def execute(self, anaconda):
@@ -914,7 +914,7 @@ class SELinux(commands.selinux.FC3_SELinux):
 
 class SkipX(commands.skipx.FC3_SkipX):
     def execute(self, anaconda):
-        self.handler.skipSteps.extend(["setsanex", "videocard", "xcustom"])
+        anaconda.ksdata.skipSteps.extend(["setsanex", "videocard", "xcustom"])
 
         if anaconda.id.desktop is not None:
             anaconda.id.desktop.setDefaultRunLevel(3)
@@ -928,7 +928,7 @@ class Timezone(commands.timezone.FC6_Timezone):
             log.warning("Timezone %s set in kickstart is not valid." % (self.timezone,))
 
         anaconda.id.timezone.setTimezoneInfo(self.timezone, self.isUtc)
-        self.handler.skipSteps.append("timezone")
+        anaconda.ksdata.skipSteps.append("timezone")
 
 class Upgrade(commands.upgrade.F11_Upgrade):
     def execute(self, anaconda):
@@ -946,7 +946,7 @@ class VolGroupData(commands.volgroup.FC3_VolGroupData):
         # Get a list of all the physical volume devices that make up this VG.
         for pv in self.physvols:
             # if pv is using --onpart, use original device
-            pv = self.handler.onPart.get(pv, pv)
+            pv = anaconda.id.ksdata.onPart.get(pv, pv)
             dev = devicetree.getDeviceByName(pv)
             if not dev:
                 raise KickstartValueError, formatErrorMsg(self.lineno, msg="Tried to use undefined partition %s in Volume Group specification" % pv)
-- 
1.6.5.2

_______________________________________________
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