[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] Better way?
From: |
Jordi Funollet |
Subject: |
Re: [Fab-user] Better way? |
Date: |
Fri, 5 Jun 2009 17:44:05 +0200 |
User-agent: |
KMail/1.11.2 (Linux/2.6.28-11-generic; KDE/4.2.2; i686; ; ) |
Curt Micol dixit:
> > I'll check out dsh, I've actually never heard of that tool. However, I
> > just added this to my fabfile:
> >
> > def runcmd(arg):
> > """Run specified command: runcmd:"ifconfig -a" """
> > if env.user != "root":
> > sudo("%s" % arg)
> > else:
> > run("%s" % arg)
> >
> > Takes care of the use case you mentioned.
Thanks for the tip, fits perfectly. I wrote a recipe that loads a list of
hosts from a file, so now I can have the same functionality that 'dsh'
provides.
http://wiki.fabfile.org/Recipes#Load_hosts_from_a_file
--
##############################
### Jordi Funollet
### http://www.terraquis.net