Looks like the cobbler/api.py version method requires
"/var/lib/cobbler/version" to be present on the local file system
which was generated by gen_build_version() in the old setup.py. With
gen_build_version() removed in 2.1.0 both cobbler_web (views.py) and
"cobbler --version" (cobbler.cli.py) are broken.
The attached patch adds gen_build_version() back to setup.py without
gitstamp, gitdate, and builddate version data (Do we really want to
include this data in the version file?). In keeping with the trend to
slim down setup.py, the patch also moves /var/lib/cobbler/version to
/etc/cobbler/version.
How to reproduce:
- Install cobbler and cobbler-web 2.1.0-2 on a clean system
- Visit http://<cobbler_host>/cobbler_web/
- run cobbler --version on the command line
Exceptions:
cobbler cli
=========
[root@madhatter ~]# cobbler --version
Cobbler 2.1.0
Traceback (most recent call last):
File "/usr/bin/cobbler", line 35, in ?
sys.exit(app.main())
File "/usr/lib/python2.4/site-packages/cobbler/cli.py", line 547, in main
rc = cli.run(sys.argv)
File "/usr/lib/python2.4/site-packages/cobbler/cli.py", line 212, in run
self.direct_command(direct_action)
File "/usr/lib/python2.4/site-packages/cobbler/cli.py", line 372, in
direct_command
print " source: %s, %s" % (version["gitstamp"],
version["gitdate"])
KeyError: 'gitstamp'
cobbler web
==========
Environment:
Request Method: GET
Request URL:
http://192.168.33.100/cobbler_web/
Django Version: 1.1.1
Python Version: 2.4.3
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'cobbler_web']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware')
Traceback:
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/share/cobbler/web/cobbler_web/views.py" in index
92. html = t.render(Context({
File "/usr/lib64/python2.4/xmlrpclib.py" in __call__
1096. return self.__send(self.__name, args)
File "/usr/lib64/python2.4/xmlrpclib.py" in __request
1383. verbose=self.__verbose
File "/usr/lib64/python2.4/xmlrpclib.py" in request
1147. return self._parse_response(h.getfile(), sock)
File "/usr/lib64/python2.4/xmlrpclib.py" in _parse_response
1286. return u.close()
File "/usr/lib64/python2.4/xmlrpclib.py" in close
744. raise Fault(**self._stack[0])
Exception Type: Fault at /cobbler_web/
Exception Value: <Fault 1: "exceptions.IOError:[Errno 2] No such file
or directory: '/var/lib/cobbler/version'">