Pete Wright wrote:
hi all,
i started working on getting cobblerd running on ubuntu-8.x. I have
been able to build a debian package from source, it picks up the
expected dependencies etc. yea! now i'm running into this problem when
i try to run cobbler:
pete@clyde:$ sudo cobbler
list index out of range
File "/usr/lib/python2.5/site-packages/cobbler/cobbler.py", line 83,
in main
rc = BootCLI().run(sys.argv)
File "/usr/lib/python2.5/site-packages/cobbler/cobbler.py", line 45,
in __init__
self.api = api.BootAPI(is_cobblerd=False)
File "/usr/lib/python2.5/site-packages/cobbler/api.py", line 110, in
__init__
self.os_version = utils.os_release()
File "/usr/lib/python2.5/site-packages/cobbler/utils.py", line 824,
in os_release
rest = parts[1]
This seems to be due to this bit of code in utils.py os_release()
definition:
elif check_dist() == "debian":
fd = open("/etc/debian_version")
parts = fd.read().split(".")
version = parts[0]
rest = parts[1]
make = "debian"
return (make, float(version), rest)
On ubuntu /etc/debian_version reads as so on ubuntu 8 system:
lenny/sid
simply changing the split to happen on a "/" does not work as it seems
that the code is expecting float for version.
I started working on patching this and I think the best way to go about
fixing this is to change utils.py's check_dist() function so that we
read /etc/lsb-release, which I *think* should help us figure out if we
are on a debian or ubuntu system - and which version it is.
So quick question:
- would it make sense to figure out what platform we are on for all
systems by reading /etc/lsb-release
Fedora has no /etc/lsb-release, though for platforms that do that seems
fine to me.
oh yea, this is from the main git branch that i pulled today
(06.25.09).
it's tagged at cobbler-1.7.0 on my system...
Yeah, development branch is the right place to be. This really should be
"1.9" as we're probably going to call this 2.0 (it's a big release), but
that doesn't matter much.
thanks!
-pete