Hi,
Attached is a patch that will allow cobbler to run on a Ubuntu system. It parses /etc/lsb-release to get the distribution name and version needed in utils.py os_release() def.

I also have updated the debian/control file that is used to build the cobbler .deb. It will now pickup some missing dependencies.

-pete

--
Pete Wright
Systems Engineer Demonware
[email protected]
office: 310.255.2000 ext 3704
mobile: 604.802.5059
>From 68c527a25f2887558dcd65bef9da097142c2774d Mon Sep 17 00:00:00 2001
From: Pete Wright <[email protected]>
Date: Tue, 30 Jun 2009 21:24:15 +0100
Subject: [PATCH] updating utils.py os_release() so that ubuntu
 and other debian based distributions are detected
 correctly.

updated control file so that newer dependencies get
picked up.
---
 cobbler/utils.py |   18 ++++++++++++------
 debian/changelog |    5 +++++
 debian/control   |    4 ++--
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/cobbler/utils.py b/cobbler/utils.py
index 5639045..7e8786f 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -781,7 +781,7 @@ def check_dist():
     """
     Determines what distro we're running under.  
     """
-    if os.path.exists("/etc/debian_version"):
+    if os.path.exists("/etc/lsb-release"):
        return "debian"
     elif os.path.exists("/etc/SuSE-release"):
        return "suse"
@@ -818,11 +818,17 @@ def os_release():
          version = float(version[0])
       return (make, float(version), rest)
    elif check_dist() == "debian":
-      fd = open("/etc/debian_version")
-      parts = fd.read().split(".")
-      version = parts[0]
-      rest = parts[1]
-      make = "debian"
+      fd = open("/etc/lsb-release")
+      lines=fd.readlines()
+      for line in lines:
+         if "DISTRIB_ID" in line:
+            dparts = line.split("=")
+            make = dparts[1]
+         if "DISTRIB_RELEASE" in line:
+            vparts = line.split("=")
+            version = vparts[1]
+# just returning nil for now
+      rest = 0
       return (make, float(version), rest)
    elif check_dist() == "suse":
       fd = open("/etc/SuSE-release")
diff --git a/debian/changelog b/debian/changelog
index 7e4a7a1..0a3d198 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,8 @@
+cobbler (1.7.0-1) unstable; urgency=low
+
+  * Release bump
+
+ -- Pete Wright <[email protected]>  Thu, 25 Jun 2009 23:14:59 +0000
 cobbler (1.5.0-1) unstable; urgency=low
 
   * Release bump
diff --git a/debian/control b/debian/control
index 8e8b039..648be4a 100644
--- a/debian/control
+++ b/debian/control
@@ -1,14 +1,14 @@
 Source: cobbler
 Section: unknown
 Priority: optional
-Maintainer: Jasper Poppe <[email protected]>
+Maintainer: Pete Wright <[email protected]>
 Build-Depends: debhelper (>= 7), python-cheetah, python-yaml, git-core, python
 Standards-Version: 3.8.0
 Homepage: https://fedoraproject.org/cobbler
 
 Package: cobbler
 Architecture: all
-Depends: ${python:Depends}, python, apache2, libapache2-mod-python, 
python-support, python-yaml, python-netaddr, python-cheetah, syslinux | 
syslinux-common
+Depends: ${python:Depends}, python, apache2, libapache2-mod-python, 
python-support, python-yaml, python-netaddr, python-cheetah, python-urlgrabber, 
syslinux | syslinux-common
 Suggests: rsync, tftpd-hpa, mkisofs, tftpd-hpa, dhcp3-server, createrepo
 Description: Install server
  Cobbler is a network install server.  Cobbler
-- 
1.5.4.3

_______________________________________________
cobbler-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler-devel

Reply via email to