fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Can't set hosts via decorator


From: Michael Gliwinski
Subject: Re: [Fab-user] Can't set hosts via decorator
Date: Mon, 20 Feb 2012 16:02:55 +0000
User-agent: KMail/1.13.6 (Linux/2.6.38-8-generic; KDE/4.6.4; x86_64; ; )

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','address@hidden')
> 
> 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 address@hidden

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
*********************************************************************************




reply via email to

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