For your consideration:
Trac Ticket #510: Modified 'cobbler buildiso' to use /var/cache/cobbler/buildiso by default. Added a /etc/cobbler/settings value of 'buildisodir' to make it setable by the end user. --tempdir will still overwrite either setting on the command line. (https://fedorahosted.org/cobbler/ticket/510)
Trac Ticket #509: Added 'self' as a argument to self.on_done() to keep the web interface from stating that buildiso failed. (https://fedorahosted.org/cobbler/ticket/509)
Andrew
On Wed, 23 Feb 2011 13:42:56 -0500, Andrew Rankin andrew@eiknet.com wrote:
For your consideration:
Trac Ticket #510: Modified 'cobbler buildiso' to use /var/cache/cobbler/buildiso by default. Added a /etc/cobbler/settings value of 'buildisodir' to make it setable by the end user. --tempdir will still overwrite either setting on the command line. (https://fedorahosted.org/cobbler/ticket/510)
Shouldn't we create /var/cache/cobbler/buildiso as part of the rpm install (and possibly part of the setup.py)?
On Wed, Feb 23, 2011 at 1:53 PM, Scott Henson shenson@redhat.com wrote:
On Wed, 23 Feb 2011 13:42:56 -0500, Andrew Rankin andrew@eiknet.com wrote:
For your consideration:
Trac Ticket #510: Modified 'cobbler buildiso' to use /var/cache/cobbler/buildiso by default. Added a /etc/cobbler/settings value of 'buildisodir' to make it setable by the end user. --tempdir will still overwrite either setting on the command line. (https://fedorahosted.org/cobbler/ticket/510)
Shouldn't we create /var/cache/cobbler/buildiso as part of the rpm install (and possibly part of the setup.py)?
-- Scott Henson Red Hat CIS Operator WVU Alum BSAE/BSME
That's a good question.
buildiso will create it if it's not there, but I do see other packages create that when they're installed (tomcat5 & yum were my spot checks). I'm happy to add it...
Andrew
On Wed, Feb 23, 2011 at 2:09 PM, Andrew Rankin andrew@eiknet.com wrote:
On Wed, Feb 23, 2011 at 1:53 PM, Scott Henson shenson@redhat.com wrote:
On Wed, 23 Feb 2011 13:42:56 -0500, Andrew Rankin andrew@eiknet.com wrote:
For your consideration:
Trac Ticket #510: Modified 'cobbler buildiso' to use /var/cache/cobbler/buildiso by default. Added a /etc/cobbler/settings value of 'buildisodir' to make it setable by the end user. --tempdir will still overwrite either setting on the command line. (https://fedorahosted.org/cobbler/ticket/510)
Shouldn't we create /var/cache/cobbler/buildiso as part of the rpm install (and possibly part of the setup.py)?
-- Scott Henson Red Hat CIS Operator WVU Alum BSAE/BSME
That's a good question.
buildiso will create it if it's not there, but I do see other packages create that when they're installed (tomcat5 & yum were my spot checks). I'm happy to add it...
Andrew
Additional patch for setup.py and cobbler.spec to create the paths attached.
Andrew
On Wed, 23 Feb 2011 14:57:28 -0500, Andrew Rankin andrew@eiknet.com wrote:
Additional patch for setup.py and cobbler.spec to create the paths attached.
Merged. Thanks!
On Wed, Feb 23, 2011 at 4:18 PM, Scott Henson shenson@redhat.com wrote:
On Wed, 23 Feb 2011 14:57:28 -0500, Andrew Rankin andrew@eiknet.com wrote:
Additional patch for setup.py and cobbler.spec to create the paths attached.
Merged. Thanks!
-- Scott Henson Red Hat CIS Operator WVU Alum BSAE/BSME
So noticed this morning that the addition of self to self.on_done() actually makes running any other background tasks show as failed through the web interface now (from a sync):
Thu Feb 24 10:26:44 2011 - INFO | ### TASK COMPLETE ### Thu Feb 24 10:26:44 2011 - INFO | Exception occured: exceptions.TypeError Thu Feb 24 10:26:44 2011 - INFO | Exception value: on_done() takes exactly 1 argument (2 given) Thu Feb 24 10:26:44 2011 - INFO | Exception Info: File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 97, in run self.on_done(self)
Thu Feb 24 10:26:44 2011 - ERROR | ### TASK FAILED ###
Looks like background_buildiso is the only thing including it's own on_done and overriding the dummy on_done in CobblerThread. Perhaps someone with greater knowledge of python can help me understand this better:
on_done is defined with CobblerThread as:
def on_done(self): pass
It's being overridden by background_buildiso with an on_done defined as:
def on_done(self): if self.options.get("iso","") == "/var/www/cobbler/pub/generated.iso": msg = "ISO now available for <A HREF="/cobbler/pub/generated.iso">download</A>" self.remote._new_event(msg)
Since background_sync is not overriding on_done, it's using the dummy defined in CobblerThread, which expects one argument. The call to it after my patch is:
self.on_done(self)
We're only sending one argument, but the 'self.' adds CobblerThread's address as the first argument so we end up with two. Fine, that's expected - but why when we call background_isobuild and it overrides the on_done does python view self.on_done(self) as only 1 argument?
My workaround was just to not define a dummy or call on_done in CobblerThread unless one is passed to it when object instance is created in __start_task (see diff). But this really is only a workaround to deal with the functions expecting a different number arguments. You still have to pass self to on_done when you call it, which confuses me - you're calling it as self.on_done(self) so shouldn't it end up with two arguments?
Andrew
On Thu, 24 Feb 2011 14:32:25 -0500, Andrew Rankin andrew@eiknet.com wrote:
My workaround was just to not define a dummy or call on_done in CobblerThread unless one is passed to it when object instance is created in __start_task (see diff). But this really is only a workaround to deal with the functions expecting a different number arguments. You still have to pass self to on_done when you call it, which confuses me - you're calling it as self.on_done(self) so shouldn't it end up with two arguments?
I think this is a class inheritance problem. I ran into something similar when I was working on some cheetah stuff. It had something to do with using super. Unfortunately I can't remember the specifics right now. I'll try to fire up a test instance and debug it if someone doesn't beat me to it first.
On Thu, Feb 24, 2011 at 3:11 PM, Scott Henson shenson@redhat.com wrote:
On Thu, 24 Feb 2011 14:32:25 -0500, Andrew Rankin andrew@eiknet.com wrote:
My workaround was just to not define a dummy or call on_done in CobblerThread unless one is passed to it when object instance is created in __start_task (see diff). But this really is only a workaround to deal with the functions expecting a different number arguments. You still have to pass self to on_done when you call it, which confuses me - you're calling it as self.on_done(self) so shouldn't it end up with two arguments?
I think this is a class inheritance problem. I ran into something similar when I was working on some cheetah stuff. It had something to do with using super. Unfortunately I can't remember the specifics right now. I'll try to fire up a test instance and debug it if someone doesn't beat me to it first.
-- Scott Henson Red Hat CIS Operator WVU Alum BSAE/BSME
Alright, it appears happy with the patch attached.
Andrew
On Tue, 1 Mar 2011 19:20:50 -0500, Andrew Rankin andrew@eiknet.com wrote:
Alright, it appears happy with the patch attached.
Applied, thanks.
On Feb 23, 2011, at 10:53 AM, Scott Henson wrote:
On Wed, 23 Feb 2011 13:42:56 -0500, Andrew Rankin andrew@eiknet.com wrote:
For your consideration:
Trac Ticket #510: Modified 'cobbler buildiso' to use /var/cache/cobbler/buildiso by default. Added a /etc/cobbler/settings value of 'buildisodir' to make it setable by the end user. --tempdir will still overwrite either setting on the command line. (https://fedorahosted.org/cobbler/ticket/510)
Shouldn't we create /var/cache/cobbler/buildiso as part of the rpm install (and possibly part of the setup.py)?
Both FTW.
Not everyone is installing from RPM, I'm sure. :D
cobbler-devel@lists.fedorahosted.org