More patches for cobbler.
by Bill Peck
I have some more patches for cobbler which I would like to get
upstream. Some add new features others make it a little more robust.
If you don't like any of them let me know what I can change to get them
accepted. :-)
[PATCH 1/6] Added new remote method clear_logs. Clearing console and
anamon logs in %pre is too late if the install never happens.
[PATCH 2/6] add X log to anamon tracking as well.
[PATCH 3/6] When adding in distros/profiles from disk don't bomb out if
missing kernel or ramdisk. just don't add it.
[PATCH 4/6] show netboot status via koan. This is really handy if you
have a system which fails to pxe boot you can create a service in
rc.local which checks the status of netboot and
calls --replace-self for example.
[PATCH 5/6] Changes to allow s390 to work. s390 has a hard limit on the
number of chars it can recieve.
[PATCH 6/6] Some systems don't reboot properly at the end of install.
s390 being one of them. This post module will call power reboot
if postreboot is in ks_meta for that system.
13 years, 9 months
[PATCH] - fix default mgmt_parameters value for sub_profiles
by Bill Peck
When the default value is <<inherit>> I'm not sure why a sub_object
default would be any different. Unless of course its the parent field.
This patch fixes the following traceback when creating a subprofile.
Wed Jun 30 11:03:57 2010 - INFO | Exception occured:
exceptions.AttributeError
Wed Jun 30 11:03:57 2010 - INFO | Exception value: 'int' object has no
attribute 'copy'
Wed Jun 30 11:03:57 2010 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1747,
in _dispatch
return method_handle(*params)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 872,
in save_profile
return self.save_item("profile",object_id,token,editmode=editmode)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 866,
in save_item
rc = self.api.add_item(what,obj)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 394, in
add_item
return
self.get_items(what).add(ref,check_for_duplicate_names=check_for_duplicate_names,save=save,logger=logger)
File "/usr/lib/python2.4/site-packages/cobbler/collection.py", line
286, in add
self.lite_sync.add_single_profile(ref.name)
File "/usr/lib/python2.4/site-packages/cobbler/action_litesync.py",
line 103, in add_single_profile
self.sync.pxegen.write_templates(profile)
File "/usr/lib/python2.4/site-packages/cobbler/pxegen.py", line 684,
in write_templates
blended = utils.blender(self.api, False, obj)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 612,
in blender
__consolidate(node,results)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 780,
in __consolidate
results[field].update(data_item.copy())
13 years, 9 months
question about sub-profiles.
by Bill Peck
I'm doing the following calls via xmlrpc to cobbler
profile = distro.install_name #RHEL5-Server-U3_nfs-i386
systemprofile = self.system.fqdn # machine-01.example.domain.com
try: # If a profile with the name of the system already exists then
use it.
pid = self.remote.get_profile_handle(self.system.fqdn, self.token)
except: # Otherwise create it new.
pid = self.remote.new_subprofile(self.token)
self.remote.modify_profile(pid, "name", self.system.fqdn, self.token)
if self.remote.read_or_write_kickstart_template(kickfile, False,
kickstart, self.token):
self.remote.modify_profile(pid, 'kickstart', kickfile, self.token)
# Set the parent of the sub-profile to the profile. in this case
RHEL5-Server-U3_nfs-i386
self.remote.modify_profile(pid, 'parent', profile, self.token)
self.remote.save_profile(pid, self.token)
else:
raise BX(_("Failed to save kickstart"))
self.remote.modify_system(system_id, 'profile', systemprofile, self.token)
self.remote.modify_system(system_id, 'netboot-enabled', True, self.token)
and getting the following traceback. Have the calls changed for creating
sub-profiles?
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - DEBUG | get_item; ['profile',
'machine-01.rhts.bos.redhat.com']
Mon Jun 28 16:24:53 2010 - INFO | Exception occured: cobbler.cexceptions.CX
Mon Jun 28 16:24:53 2010 - INFO | Exception value: 'internal error,
unknown profile name machine-01.example.domaincom'
Mon Jun 28 16:24:53 2010 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1747,
in _dispatch
return method_handle(*params)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 635,
in get_profile_handle
return self.get_item_handle("profile",name,token)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 629,
in get_item_handle
raise CX("internal error, unknown %s name %s" % (what,name))
Mon Jun 28 16:24:53 2010 - INFO | REMOTE new_item(profile); user(testing)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing', 'new_profile',
None, None, True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE modify_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==);
attribute(name)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'modify_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
'name', True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE write_kickstart_template;
user(testing);
name(/var/lib/cobbler/kickstarts/machine-01.rhts.bos.redhat.com.ks)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'write_kickstart_template',
'/var/lib/cobbler/kickstarts/machine-01.rhts.bos.redhat.com.ks', False,
True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE modify_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==);
attribute(kickstart)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'modify_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
'kickstart', True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE modify_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==);
attribute(parent)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'modify_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
'parent', True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | REMOTE save_item(profile);
user(testing);
object_id(___NEW___profile::QHmMSb55/C3as9PQff5FdRH/gpldrMwf2A==)
Mon Jun 28 16:24:53 2010 - DEBUG | authorize; ['testing',
'save_profile', <cobbler.item_profile.Profile instance at 0x895c7e8>,
None, True]
Mon Jun 28 16:24:53 2010 - DEBUG | REMOTE testing authorization result:
True; user(?)
Mon Jun 28 16:24:53 2010 - INFO | add_item(profile);
['machine-01.rhts.bos.redhat.com']
Mon Jun 28 16:24:53 2010 - DEBUG | get_items; ['profile']
Mon Jun 28 16:24:53 2010 - INFO | Exception occured:
exceptions.AttributeError
Mon Jun 28 16:24:53 2010 - INFO | Exception value: 'int' object has no
attribute 'copy'
Mon Jun 28 16:24:53 2010 - INFO | Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1747,
in _dispatch
return method_handle(*params)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 872,
in save_profile
return self.save_item("profile",object_id,token,editmode=editmode)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 866,
in save_item
rc = self.api.add_item(what,obj)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 394, in
add_item
return
self.get_items(what).add(ref,check_for_duplicate_names=check_for_duplicate_names,save=save,logger=logger)
File "/usr/lib/python2.4/site-packages/cobbler/collection.py", line
286, in add
self.lite_sync.add_single_profile(ref.name)
File "/usr/lib/python2.4/site-packages/cobbler/action_litesync.py",
line 103, in add_single_profile
self.sync.pxegen.write_templates(profile)
File "/usr/lib/python2.4/site-packages/cobbler/pxegen.py", line 684,
in write_templates
blended = utils.blender(self.api, False, obj)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 612,
in blender
__consolidate(node,results)
File "/usr/lib/python2.4/site-packages/cobbler/utils.py", line 780,
in __consolidate
results[field].update(data_item.copy())
13 years, 10 months
[PATCH] Fixing cobbler web and cobbler --version command in 2.1.0
by Kelsey Hightower
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'">
13 years, 10 months
Bugfix patches for cobbler
by Bill Peck
I've been carrying these patches to cobbler in our local version. I did
these against remotes/origin/master so I don't believe you already have
them committed. If I should do these against a different branch then
let me know and I will.
13 years, 10 months
[PATCH] /var/lib/cobbler/.mtime tolerance
by Alan Fitton
Hi cobbler-devel,
I'm at a customer whose /var partition had filled up. I extended it, but
was subsequently unable to restart cobblerd, being given the following
traceback. It appears that when the /var partition was filled up, this
file became empty. My small patch causes the .mtime file to be recreated
if it is empty or unable to be parsed for whatever reason. Also,
cobblerd --daemonize incorrectly returns success so the init script
reports "[ OK ]".
Starting cobbler daemon: Traceback (most recent call last):
File "/usr/bin/cobblerd", line 91, in main
app.core(api)
File "/usr/lib/python2.6/site-packages/cobbler/cobblerd.py", line 50,
in core
do_xmlrpc_tasks(bootapi, settings, xmlrpc_port)
File "/usr/lib/python2.6/site-packages/cobbler/cobblerd.py", line 68,
in do_xmlrpc_tasks
do_xmlrpc_rw(bootapi, settings, xmlrpc_port)
File "/usr/lib/python2.6/site-packages/cobbler/cobblerd.py", line
106, in do_xmlrpc_rw
xinterface =
remote.ProxiedXMLRPCInterface(bootapi,remote.CobblerXMLRPCInterface)
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 1731,
in __init__
self.proxied = proxy_class(api)
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 124,
in __init__
self.timestamp = self.api.last_modified_time()
File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 189, in
last_modified_time
return float(data)
ValueError: empty string for float()
[ OK ]
Regards,
Alan
--
Alan Fitton, RHCE
Red Hat UK Professional Services Consultant
Mobile: +44 (0)7826 870264
GPG: CE3A 0EBB ED88 C233 E178 8796 12F7 8F0F 5548 6080
13 years, 10 months
virt-clone functionality
by Thomas S Hatch
It appears that the virt-clone functionality is not implimented (despite
being documented:
https://fedorahosted.org/cobbler/wiki/KoanVirtualImageCloning ).
I am looking into implementing this, since my company badly needs this
feature, are there any ideas as to what needs to happen to make this
possible? Are there any ideas as to how it should be implemented?
I imagine that I should just use the virt-clone system to do so.
Any suggestions?
-Tom Hatch
13 years, 10 months
[PATCH]: new "sleep" optional arg to system reboot
by Scott Beardsley
I ran into a problem where my nodes are not rebooting because the
delay between poweroff and poweron in cobbler is too short (currently
the default is 5secs). The following is a patch to accept a
user-supplied argument to the system reboot command that specifies the
number of seconds to sleep between poweroff and poweron. This is my
first commit so let me know if there is another process for getting
this into the master branch. I maintained the default of 5secs so
there really shouldn't be any changes to the default behavior.
Here is the patch:
http://github.com/sc0ttbeardsley/cobbler/commit/690e0b47b76390186d6f63af7...
Scott
13 years, 10 months
New way to build cobbler
by Scott Henson
As I've been doing the last few releases, I've gotten increasingly
unhappy with the way that the cobbler releases are built. Toward that,
I've had Alex Kesling has been helping fix this problem. He went
through and fixed setup.py to build a good sdist and install cobbler in
a sane way. After that, I went through and cleaned up the spec file.
These changes can be found on the master branch of my github[0].
Assuming no one has any major problems with these changes, I'm going to
update the documentation and push this to fedorahosted in the next few
days. I plan on pushing these changes to stable as I loathe the thought
of doing another release the old way.
Any additional ideas on how to clean up the build process would be
greatly appreciated. Thanks.
--
Scott Henson
Red Hat CIS Operator
WVU Alum BSAE/BSME
13 years, 10 months