summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2006-05-01 16:19:00 -0400
committerJim Meyering <jim@meyering.net>2006-05-01 16:19:00 -0400
commitccbfef1b4c7aacbcccaf311232dfda6bcb42c78c (patch)
tree3b6ffa5bcd54bb6b5494d75139432818afc1a23a
parentc9f6c22af31a6366928541780cf1a9c7d01976d0 (diff)
downloadthird_party-cobbler-ccbfef1b4c7aacbcccaf311232dfda6bcb42c78c.tar.gz
third_party-cobbler-ccbfef1b4c7aacbcccaf311232dfda6bcb42c78c.tar.xz
third_party-cobbler-ccbfef1b4c7aacbcccaf311232dfda6bcb42c78c.zip
Make kickstarts optional.
-rw-r--r--sync.py9
-rw-r--r--util.py2
2 files changed, 4 insertions, 7 deletions
diff --git a/sync.py b/sync.py
index 872c264..564cc32 100644
--- a/sync.py
+++ b/sync.py
@@ -126,10 +126,7 @@ class BootSync:
for g in self.api.get_profiles().contents():
self.sync_log("mirroring any local kickstarts: %s" % g.name)
kickstart_path = self.api.utils.find_kickstart(g.kickstart)
- if kickstart_path is None:
- self.api.last_error = m("err_kickstart") % (g.name, g.kickstart)
- raise "error"
- if os.path.exists(kickstart_path):
+ if kickstart_path and os.path.exists(kickstart_path):
# the input is an *actual* file, hence we have to copy it
copy_path = os.path.join(self.api.config.tftpboot, "kickstarts", g.name)
self.mkdir(copy_path)
@@ -139,8 +136,6 @@ class BootSync:
except:
self.api.last_error = m("err_kickstart2") % (g.kickstart,dest)
raise "error"
- elif kickstart_path.startswith("/"):
- self.api_last_error = m("err_kickstart") % (kickstart_path,g.name)
def build_trees(self):
"""
@@ -266,7 +261,7 @@ class BootSync:
fd = self.open_file(filename,"w+")
# if kickstart path is local, we've already copied it into
# the HTTP mirror, so make it something anaconda can get at
- if profile.kickstart.startswith("/"):
+ if profile.kickstart and profile.kickstart.startswith("/"):
profile.kickstart = "http://%s/cobbler/kickstarts/%s/ks.cfg" % (self.api.config.server, profile.name)
self.tee(fd,yaml.dump(profile.to_datastruct()))
self.close_file(fd)
diff --git a/util.py b/util.py
index 08bc937..f7dd473 100644
--- a/util.py
+++ b/util.py
@@ -143,6 +143,8 @@ class BootUtil:
If a local path is used, cobbler will copy the kickstart and serve
it over http.
"""
+ if url is None:
+ return None
x = url.lower()
for y in ["http://","nfs://","ftp://","/"]:
if x.startswith(y):