Code review comment for lp:~johnsca/charm-helpers/services-callback-fu

Revision history for this message
Cory Johns (johnsca) wrote :

On 2014/05/22 23:47:43, benjamin.saller wrote:
> We should also consider an 'incomplete' event, if a relation is broken
we might
> stop the service for example.

> stop is fine, for a stop hook, but incomplete would be for
relation-broken
> hooks. We can defer that till we actually intend to support it though.

I wonder if we should change "complete" to "start," since what we're
really saying is "this code should run when the service is ready to
start." Then, "stop" can be called if stop_services() is called or if a
relationship gets broken such that the service no longer has all of the
valid information ("this code should run when the service has to stop,
for whatever reason").

> Handle single argument string calls,

https://codereview.appspot.com/98490043/diff/1/tests/core/test_services.py#newcode94

`foo(*args)` is a "varargs" definition. It will accept `foo()`,
`foo('bar')`, `foo('bar', 'baz')`, etc. (but not `params = ['bar',
'baz']; foo(params)`; that would have to be written `params = ['bar',
'baz']; foo(*params)`), and `args` will automatically be a list.

https://codereview.appspot.com/98490043/

« Back to merge proposal