fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Using environment lists?


From: Jeff Forcier
Subject: Re: [Fab-user] Using environment lists?
Date: Fri, 29 Oct 2010 10:08:48 -0400

Hi Rudiger,

Since Python doesn't (IIRC) let you pop arbitrary expressions into
string interpolation, you'll need to break that particular value out
into its own variable, something like this:

env.site_list_string = ",".join(env.site_list)
run('mkdir -p 
%(www_path)s/{%(site_list_string)s}/{public,private,log,cgi-bin,backup}'
%env,pty=True)

In other words, just get your Python list into a format that can be
brace-expanded at the Bash level, similarly to what you're already
doing with the hardcoded directory names at the end. Pretty sure
that'll work.

Best,
Jeff

On Fri, Oct 29, 2010 at 2:56 AM, Rudiger Wolf
<address@hidden> wrote:
> Any tips on how I can get
>
> run('mkdir -p
> %(www_path)s/%(site_list)s/{public,private,log,cgi-bin,backup}' %env,
> pty=True)
>
> working where site_list = ['siteA','SiteB']?
>
> Thanks
> Rudiger
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby developer
http://bitprophet.org



reply via email to

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