Author Topic: Bug - Python - Docs - qb.workerlock()  (Read 5818 times)

pboucher

  • VFX Geek
  • Full Member
  • ***
  • Posts: 24
    • XSIBlog
Bug - Python - Docs - qb.workerlock()
« 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
  ...

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: Bug - Python - Docs - qb.workerlock()
« Reply #1 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.

pboucher

  • VFX Geek
  • Full Member
  • ***
  • Posts: 24
    • XSIBlog
Re: Bug - Python - Docs - qb.workerlock()
« Reply #2 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()

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: Bug - Python - Docs - qb.workerlock()
« Reply #3 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

pboucher

  • VFX Geek
  • Full Member
  • ***
  • Posts: 24
    • XSIBlog
Re: Bug - Python - Docs - qb.workerlock()
« Reply #4 on: January 08, 2008, 09:00:02 PM »
Excellent news. Thanks!