[Et-mgmt-commits-list] [SCM] koan branch, master now at v0.2.9-13-g38160ed

Michael DeHaan mdehaan at redhat.com
Fri Jun 22 22:51:18 UTC 2007


Hello,

This is an automated email from the git hooks/update script, it was
generated because a ref change was pushed to the repository.

Updating branch, master,
       via  38160ed70e263b80aa0759fc3d7aa812470d77b9 (commit)
       via  ac000ba4ec283a4dd56ec4f3e2e5186a6b5c77c4 (commit)
      from  9afff120a3787ba82ab2313aa968e2751efe309f (commit)

- Log -----------------------------------------------------------------
commit 38160ed70e263b80aa0759fc3d7aa812470d77b9
Author: Michael DeHaan <mdehaan at mdehaan.rdu.redhat.com>
Date:   Fri Jun 22 18:52:42 2007 -0400

    Updating koan to better use XMLRPC API and be a bit more simplified in a few places.

commit ac000ba4ec283a4dd56ec4f3e2e5186a6b5c77c4
Author: Michael DeHaan <mdehaan at mdehaan.rdu.redhat.com>
Date:   Fri Jun 22 18:47:46 2007 -0400

    Remove some dead code that doesn't apply anymore.
-----------------------------------------------------------------------

Diffstat:
 koan/app.py |   45 +++++++++++++--------------------------------
 1 files changed, 13 insertions(+), 32 deletions(-)

diff --git a/koan/app.py b/koan/app.py
index b21fb2a..598c80d 100755
--- a/koan/app.py
+++ b/koan/app.py
@@ -258,7 +258,6 @@ class Koan:
         """
         Actually kicks off downloads and auto-ks or virt installs
         """
-        # self.debug("processing profile: %s" % self.profile)
         if self.profile:
             profile_data = self.get_profile_xmlrpc(self.profile)
         else:
@@ -441,20 +440,27 @@ class Koan:
 
     def get_profiles_xmlrpc(self):
         try:
-            return self.xmlrpc_server.get_profiles()
+            data = self.xmlrpc_server.get_profiles()
         except:
             traceback.print_exc()
             self.connect_fail()
+        if data == {}:
+            raise InfoException("No profiles found on cobbler server")
+        return data
 
     def get_profile_xmlrpc(self,profile_name):
         """
         Fetches profile yaml from a from a remote bootconf tree.
         """
         try:
-            return self.xmlrpc_server.get_profile_for_koan(profile_name)
+            data = self.xmlrpc_server.get_profile_for_koan(profile_name)
         except:
             traceback.print_exc()
             self.connect_fail()
+        if data == {}:
+            raise InfoException("no cobbler entry for this profile")
+        return data
+
 
     def get_systems_xmlrpc(self):
         try:
@@ -483,17 +489,6 @@ class Koan:
             return True
         return False
 
-    def fix_mac(self,strdata):
-        """ Make a MAC look PXE-ish """
-        return "01-" + "-".join(strdata.split(":")).lower()
-
-    def fix_ip(self,ip):
-        """ Make an IP look PXE-ish """
-        handle = sub_process.Popen("/usr/bin/gethostip %s" % ip, shell=True, stdout=sub_process.PIPE)
-        out = handle.stdout
-        results = out.read()
-        return results.split(" ")[-1][0:8]
-
     def get_system_xmlrpc(self,system_name):
         """
         If user specifies --system, return the profile data
@@ -501,29 +496,15 @@ class Koan:
         of what was specified in the system's profile.
         """
         system_data = None
-        self.debug("fetching configuration for system: (%s)" % system_name)
         try:
             system_data = self.xmlrpc_server.get_system_for_koan(system_name)
         except:
             traceback.print_exc()
             self.connect_fail()
-        profile_data = self.get_profile_xmlrpc(self.safe_load(system_data,'profile'))
-        # system overrides the profile values where relevant
-        profile_data.update(system_data)
-        try_this = "http://%s/cobbler/kickstarts_sys/%s/ks.cfg" % (self.server,system_name)
-        try:
-            # can only use a per-system kickstart if it exists.  It may
-            # be that the cobbler config file already references a http
-            # kickstart, hence the per-system kickstart is just a per
-            # profile kickstart, and we can't use it.
-            # FIXME
-            self.urlread(try_this)
-            profile_data['kickstart'] = try_this
-        except:
-            # just use the profile kickstart, whatever it is
-            pass
-        print profile_data
-        return profile_data
+        if system_data == {}:
+            raise InfoException("no cobbler entry for system")        
+        print system_data
+        return system_data
 
     def get_distro_files(self,profile_data, download_root):
         """

hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
  9afff120a3787ba82ab2313aa968e2751efe309f \
  38160ed70e263b80aa0759fc3d7aa812470d77b9




More information about the Et-mgmt-commits-list mailing list