diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-10-09 18:26:51 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-10-09 18:26:51 -0400 |
commit | 2100bcd4e66801dd37bd90d11442f2f12af6ae1e (patch) | |
tree | 5737c22265ef4a73ec2908cbcaec0734307a3f93 /cobbler/action_sync.py | |
parent | eed99bc005aa702729d23ddd168db5c219b5c7b3 (diff) | |
download | third_party-cobbler-2100bcd4e66801dd37bd90d11442f2f12af6ae1e.tar.gz third_party-cobbler-2100bcd4e66801dd37bd90d11442f2f12af6ae1e.tar.xz third_party-cobbler-2100bcd4e66801dd37bd90d11442f2f12af6ae1e.zip |
Have cobbler print a basic listing of configured profiles and systems
to enable remote apps to list available things that can be provisioned.
Diffstat (limited to 'cobbler/action_sync.py')
-rw-r--r-- | cobbler/action_sync.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/cobbler/action_sync.py b/cobbler/action_sync.py index 3720676..9d0725d 100644 --- a/cobbler/action_sync.py +++ b/cobbler/action_sync.py @@ -17,7 +17,7 @@ import os import os.path import shutil import time -import yaml +import yaml # Howell-Clark version import subprocess import sys from Cheetah.Template import Template @@ -344,7 +344,10 @@ class BootSync: Usually it's just one or the other. """ + self.sync_log(cobbler_msg.lookup("sync_buildtree")) + self.write_listings() + # create pxelinux.cfg under tftpboot # and file for each MAC or IP (hex encoded 01-XX-XX-XX-XX-XX-XX) @@ -489,6 +492,23 @@ class BootSync: self.close_file(fd) self.sync_log("--------------------------------") + def write_listings(self): + """ + Creates a very simple index of available systems and profiles + that cobbler knows about. Just the names, no details. + """ + names1 = [x.name for x in self.profiles] + names2 = [x.name for x in self.systems] + data1 = yaml.dump(names1) + data2 = yaml.dump(names2) + fd1 = self.open_file(os.path.join(self.settings.webdir, "profile_list"), "w+") + fd2 = self.open_file(os.path.join(self.settings.webdir, "system_list"), "w+") + self.tee(fd1, data1) + self.tee(fd2, data2) + self.close_file(fd1) + self.close_file(fd2) + self.sync_log("--------------------------------") + def write_distro_file(self,filename,distro): """ Create distro information for xen-net-install @@ -502,7 +522,6 @@ class BootSync: self.tee(fd,yaml.dump(distro.to_datastruct())) self.close_file(fd) - def write_profile_file(self,filename,profile): """ Create profile information for xen-net-install |