Grabbing user input in the %pre section using the python snack library

vs victor_sira at yahoo.com
Mon Nov 9 05:39:56 UTC 2009


----- Original Message ----

> From: James Cammarata <jimi at sngx.net>
> To: Discussion list about Kickstart <kickstart-list at redhat.com>
> Sent: Wed, November 4, 2009 6:05:23 PM
> Subject: Re: Grabbing user input in the %pre section using the python snack library
> 
> 
> On Wed, 04 Nov 2009 20:56:33 -0500, Eric Smith wrote:
> > See:
> > http://www.trueblade.com/techblog/user-input-during-a-fedora-kickstart
> > 
> > Hope that helps.
> > Eric.
> > 
> > Glenn Bailey wrote:
> >> Howdy folks,
> >> 
> >> I've been beating my head trying to get this darn thing to work. I can
> >> easily grab user input via straight shell in the following example:
> >> 
> >> %pre
> >> chvt 3
> >> exec /dev/tty3 2>/dev/tty3
> >> echo -n "Enter the hostname: "
> >> read HOSTNAME
> >> echo "You entered: $HOSTNAME"
> >> 
> >> But, what I am trying to do is use the python snack library, and I'm
> >> having no luck. I couldn't find a pure python solution, so I tried some
> >> tricks and came up with the following:
> >> 
> >> %pre
> >> chvt 3
> >> exec /dev/tty3 2>/dev/tty3
> >> /usr/bin/python <
> >> 
> >> import os, sys
> >> from snack import *
> >> 
> >> title = "Linux Build"
> >> buttons = ['Ok', 'Cancel']
> >> width = 40
> >> help = "None"
> >> textItems = "Hello!"
> >> text = "Confirm options"
> >> screen = SnackScreen()
> >> ButtonChoiceWindow(screen, title, textItems, ['Start Build', 'Re-input
> >> Items'],
> >>                    width, 0,0,help)
> >> screen.finish()
> >> 
> >> EOF
> >> 
> >> Which will display the screen, but it still takes input from tty1. Any
> >> ideas to WTH is going on? Looking through the archives I found some pure
> >> python examples, but they did nada fer me .. I'd take a solution in
> shell
> >> or python as long as it works ;-)
> 
> In my opinion, kickstarts should be completely automated with no user
> input.  I'd recommend looking into a provisioning system like Cobbler,
> which allows you to setup all the information about the system your
> building before the kickstart begins.

I agree with this comment, but for networking information and if you don't use dhcp reservations, how can you feed this information back in to the setup? I imagine you can setup your own text files somewhere that match name,ip etc to mac addresses for example, but is there a better solution? Or does cobbler has a built in way to handle this?

--Victor



> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list



      __________________________________________________________________
The new Internet Explorer® 8 - Faster, safer, easier.  Optimized for Yahoo!  Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/




More information about the Kickstart-list mailing list