On Tuesday 14 Feb 2012 13:33:27 Ben Cole wrote:
> Hi,
> 
> I have a fabfile set up as shown here:  http://dpaste.de/LpcVF/
> 
> However when I call
> 
> do_service('httpd','status','root@localhost')
> 
> I get
> 
> TypeError: 'list' object is not callable
> 
> However if I try setting the env.hosts variable to hosts instead of using
> the @hosts decorator, I then get
> 
> No hosts found. Please specify (single) host string for connection:

First thing is you're assigning a list of hosts to 'hosts' variable, hence in 
@hosts(*hosts) - hosts is a list, not a function.  You'd need to rename your 
variable, and also remember to 'from fabric.api import hosts'.

Also, I don't think it will work with a closure, since do_service is a task 
itself, I don't think it can just define additional tasks.  Have a look at 
execute() function in docs, it may be a better fit.


-- 
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319

**********************************************************************************************
The information in this email is confidential and may be legally privileged.  
It is intended solely for the addressee and access to the email by anyone else 
is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or 
any action taken or omitted to be taken in reliance on it, is prohibited and 
may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail 
are subject to the terms and conditions expressed  in the governing client 
engagement leter or contract.
If you have received this email in error please notify 
[email protected]

John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland, 
BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
*********************************************************************************


_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to