workerpool: Change signature of AddTask function to not use *args
authorMichael Hanselmann <hansmi@google.com>
Sat, 17 Jul 2010 21:04:32 +0000 (23:04 +0200)
committerMichael Hanselmann <hansmi@google.com>
Thu, 29 Jul 2010 13:05:56 +0000 (15:05 +0200)
commitb2e8a4d92aaa66d4123a654d86c449b22e953efe
tree845d488942a99dc4194bc3ae19914784f4394171
parentc1cf1fe51176fa71a7ef217ad8042c007000df66
workerpool: Change signature of AddTask function to not use *args

By changing it to a normal parameter, which must be a sequence, we can
start using keyword parameters.

Before this patch all arguments to “AddTask(self, *args)” were passed as
arguments to the worker's “RunTask” method. Priorities, which should be
optional and will be implemented in a future patch, must be passed as a keyword
parameter. This means “*args” can no longer be used as one can't combine *args
and keyword parameters in a clean way:

>>> def f(name=None, *args):
...   print "%r, %r" % (args, name)
...
>>> f("p1", "p2", "p3", name="thename")
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 TypeError: f() got multiple values for keyword argument 'name'

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
daemons/ganeti-masterd
lib/jqueue.py
lib/workerpool.py
test/ganeti.workerpool_unittest.py
tools/move-instance