I've resisted adding a version command to Cobbler because rpm and yum provide a better one, and it's not easy to define a version in the age of distributed version control for developer versions when everyone is on a different branch. Returning just one number is wholly insufficient. Packaging for non-rpm distros, however, will require that we have an option, and often folks have the question of when did they last do a checkout.
So, cobbler now has a version command:
[root@localhost koan]# cobbler --version cobbler 1.3.2
build date : Tue Nov 18 12:30:40 2008 git hash : 9fe5605e0f302d1de76235a4150d3b01e2b6e42c git date : Tue Nov 18 12:27:21 2008 -0500
Copyright (C) 2006-2008 Red Hat, Inc. License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Written by Michael DeHaan.
=====
For those applications talking to cobbler remotely, the call remote.extended_version() will return a hash with all of this information. The existing api.version() call is left working as is for backwards compatibility (as koan needs to be able to query any cobbler server).
This works by writing a YAML file into /var/lib/cobbler/version, which is fairly low tech, but works nicely.
--Michael
--- Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile index 536007e..ac19cf3 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ clean: -rm -f cobbler/*.pyc -rm -f cobbler/yaml/*.pyc -rm -f cobbler/webui/master.py - -rm -f config/modules.conf config/settings + -rm -f config/modules.conf config/settings config/version -rm -f docs/cobbler.1.gz docs/cobbler.html
manpage:
cobbler@lists.fedorahosted.org