imgcreate/kickstart.py | 4 +++-
livecd-tools.spec | 1 +
tools/livecd-creator | 6 +++---
3 files changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 26e3c100f567e0132847e0ef0ac6b42b8d35f727
Author: Bryan Kearney <bkearney(a)redhat.com>
Date: Tue Nov 25 10:55:25 2008 -0500
Allow URLs for kickstart config
Allow for http://, ftp://, or file:// urls to be passed in to the
image creators using urlgrabber. This verison delagets all work to
urlgrabber and all error checking to the kickstart parser
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index c97eb08..58171c4 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -22,6 +22,7 @@ import shutil
import subprocess
import time
import logging
+import urlgrabber
import rhpl.keyboard
@@ -47,7 +48,8 @@ def read_kickstart(path):
version = ksversion.makeVersion()
ks = ksparser.KickstartParser(version)
try:
- ks.readKickstart(path)
+ ksfile = urlgrabber.urlgrab(path)
+ ks.readKickstart(ksfile)
except IOError, (err, msg):
raise errors.KickstartError("Failed to read kickstart file "
"'%s' : %s" % (path, msg))
diff --git a/livecd-tools.spec b/livecd-tools.spec
index 7ab1468..215b576 100644
--- a/livecd-tools.spec
+++ b/livecd-tools.spec
@@ -21,6 +21,7 @@ Requires: pykickstart >= 0.96
Requires: dosfstools >= 2.11-8
Requires: isomd5sum
Requires: rhpl
+Requires: python-urlgrabber
%ifarch %{ix86} x86_64
Requires: syslinux
%endif
diff --git a/tools/livecd-creator b/tools/livecd-creator
index b401190..6d84e4c 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -36,7 +36,7 @@ def parse_options(args):
imgopt = optparse.OptionGroup(parser, "Image options",
"These options define the created image.")
imgopt.add_option("-c", "--config", type="string", dest="kscfg",
- help="Path to kickstart config file")
+ help="Path or url to kickstart config file")
imgopt.add_option("-b", "--base-on", type="string", dest="base_on",
help="Add packages to an existing live CD iso9660 image.")
imgopt.add_option("-f", "--fslabel", type="string", dest="fs_label",
@@ -67,8 +67,8 @@ def parse_options(args):
help=optparse.SUPPRESS_HELP)
(options, args) = parser.parse_args()
- if not options.kscfg or not os.path.isfile(options.kscfg):
- raise Usage("Kickstart config '%s' does not exist" %(options.kscfg,))
+ if not options.kscfg:
+ raise Usage("Kickstart file must be provided")
if options.base_on and not os.path.isfile(options.base_on):
raise Usage("Live CD ISO '%s' does not exist" %(options.base_on,))
if options.fs_label and len(options.fs_label) > imgcreate.FSLABEL_MAXLEN: