PipelineFX Forum

Qube! => Developer Customization => Topic started by: pboucher on November 09, 2007, 08:41:38 PM

Title: Bug - Python - Docs - qb.workerlock()
Post by: pboucher on November 09, 2007, 08:41:38 PM
I think the examples should read:

qb.workerlock({}, 'host.processor_0=1,host.processor_1=1', name='myhost')
qb.workerlock({}, 'host.processor_all=0', name='myhost')
qb.workerlock({}, 'host.processor_all=1', name='myhost')
qb.workerlock({}, 'host.lock_mode=aggressive,host.processor_all=watchdog 30', name='myhost')

otherwise the method definition should read:
def workerlock(filters=None, lockingString='host.processor_all=1', name=None):
  if filters.has_key('name') == False and name == None:
    raise SomeException
  ...
Title: Re: Bug - Python - Docs - qb.workerlock()
Post by: Scot Brew on November 09, 2007, 09:43:39 PM
Thank you for the python docs and usability suggestion.  We will see about incorporating it in an upcoming release.
Title: Re: Bug - Python - Docs - qb.workerlock()
Post by: pboucher on November 09, 2007, 10:25:32 PM
By using the above method definition could I even suggest there be a lock method on the host object. The host object supplies the name and with the defaults, one could do the following to lock a bunch of workers:

for h in qb.hostinfo():
  if [my logic on h]:
    h.lock()
Title: Re: Bug - Python - Docs - qb.workerlock()
Post by: Scot Brew on November 09, 2007, 10:58:25 PM
Thank you again. 

The workerlock() function is being updated with improved error checking to address your reported issue and suggestion.  We plan to further enhance it by adding 'lock' and 'purge' parameter shortcuts to make it easier to use.  Below is the planned prototype.

Code: [Select]
def workerlock(filters={}, lockingString='', name=None, lock=None, purge=False):

Your feature suggestion for making the Qube classes (Job, Host, etc) more object oriented has also been logged and will be prioritized with our other development items.

Regards,
Scot
Title: Re: Bug - Python - Docs - qb.workerlock()
Post by: pboucher on January 08, 2008, 09:00:02 PM
Excellent news. Thanks!