Re: Anaconda Traceback when using %pre scripts

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

 



On Sun, 4 May 2008, Peter Åstrand wrote:

> My conclusion is that %pre scripts in the latest pykickstart is broken. It 
> remains the find which patch is causing this. 

Looking at the differences between 1.18 and 1.29, I see:

@@ -151,7 +152,8 @@
        script.  Instances of Script are held in a list by the Version object.
     """
     def __init__(self, script, interp = "/bin/sh", inChroot = False,
-                 logfile = None, errorOnFail = False, type = KS_SCRIPT_PRE):
+                 lineno = None, logfile = None, errorOnFail = False,
+                 type = KS_SCRIPT_PRE):
         """Create a new Script instance.  Instance attributes:

That is, the lineno argument has been introduced, which shifts the order 
of all following arguments. The Script usage in pykickstart has been 
updated to reflect this. BUT: Anaconda also uses this class:

In /usr/lib/anaconda/kickstart.py:

class AnacondaKSScript(Script):

...

        s = AnacondaKSScript (self._script["body"], self._script["interp"],
                              self._script["chroot"], self._script["log"],
                              self._script["errorOnFail"])
...

        s = AnacondaKSScript (self._script["body"], self._script["interp"],
                              self._script["chroot"], self._script["log"],
                              self._script["errorOnFail"], self._script["type"])

Since we are not using keyword arguments, the logfile is assigned the 
value of self._script["errorOnFail"], which is False. 

Changing APIs in this way is not very nice. I suggest that the patch is 
changed, so that lineno is added to the end of the list. 

Regards, 
---
Peter Åstrand		ThinLinc Chief Developer
Cendio AB		http://www.cendio.se
Wallenbergs gata 4
583 30 Linköping	Phone: +46-13-21 46 00
_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux