fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] invoke() is broken.


From: Christian Vest Hansen
Subject: Re: [Fab-user] invoke() is broken.
Date: Sun, 26 Oct 2008 16:37:31 +0200

On Sun, Oct 26, 2008 at 3:50 PM, Niklas Lindström <address@hidden> wrote:
> Hi,
>
> I believe this is because `invoke` (actually, `_execute_command`)
> cannot be called in a nested fashion, as I just wrote in reply to your
> suggestion to remove `require`. Where I suggest to remove `invoke` and
> integrate it into "@depends".
>
> I actually sort of expected this when I wrote the "call chain"
> mechanism, but I left `invoke` behind in spite of it.. Previous to the
> call chain I made connections hashable and reworked `_connect` to say
> if it actually connected etc. But that got very hairy, so I added call
> chain instead (which is closer to how it works when you supply a list
> of commands to the fab command).
>
> I hope this'll solve the problem.

If by "this" you refer to folding `require` and `invoke` into their
respective decorators, then I'd say it's a step in the right
direction, but as I mentioned in my other mail, the `c31()` example
will still break.

Are/will you be working on these changes?

>
> Best regards,
> Niklas
>
>
>
> On Sun, Oct 26, 2008 at 3:33 PM, Christian Vest Hansen
> <address@hidden> wrote:
>> Niklas & Jeff,
>>
>> It seems that the `invoke()` operation and the way commands are
>> called, etc. interacts in mysterious ways. I can't seem to figure out
>> why things fail, but I have compiled the following list of ways
>> `invoke()` can break:
>>
>>
>> # Illustrates how the `invoke()` operation is broken.
>> config.fab_hosts=['localhost']
>> def a():
>>    run("echo a")
>>
>> # Works:
>> @depends(a)
>> def b1():
>>    run("echo b1")
>>
>> # Broken, a() called twice, no b2:
>> def b2():
>>    invoke(a)
>>    run("echo b2")
>>
>> # Works:
>> def b3():
>>    a()
>>    run("echo b3")
>>
>> # Works:
>> @depends(b1)
>> def c11():
>>    run("echo c11")
>>
>> # Semi-works, b2 still breaks:
>> @depends(b2)
>> def c12():
>>    run("echo c12")
>>
>> # Works:
>> @depends(b3)
>> def c13():
>>    run("echo c13")
>>
>> # Broken, a() called twice, no c21:
>> def c21():
>>    invoke(b1)
>>    run("echo c21")
>>
>> # Totally broken, a() called thrice:
>> def c22():
>>    invoke(b2)
>>    run("echo c22")
>>
>> # Broken, a() called twice, no c23:
>> def c23():
>>    invoke(b3)
>>    run("echo c23")
>>
>> # Broken, a() not called:
>> def c31():
>>    b1()
>>    run("echo c31")
>>
>> # Broken, a() called twice, then stops:
>> def c32():
>>    b2()
>>    run("echo c32")
>>
>> # Works:
>> def c33():
>>    b3()
>>    run("echo c33")
>>
>>
>>
>> --
>> Venlig hilsen / Kind regards,
>> Christian Vest Hansen.
>>
>>
>> _______________________________________________
>> Fab-user mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]