Norbert, I think you're looking for the "settings" context manager: http://readthedocs.org/docs/fabric/en/latest/api/core/context_managers.html#fabric.context_managers.settings
>From the page: - Most usefully, it allows temporary overriding/updating of env with any provided keyword arguments, e.g. with settings(user='foo'):. Original values, if any, will be restored once the with block closes. -Ed Brannin edbran...@gmail.com cell: 585-261-0279 On Sun, Mar 27, 2011 at 3:57 AM, Klamann, Norbert < norbert.klam...@klamann-software.de> wrote: > Hello all, > i want to use fabric for the distribution of plone instances and my scnario > is as follows: > On each (virtual) mchine I have a system user 'plone', who owns the > installation and shall handle the day to day business. This user has no > password, can only login with ssh and public key. This user cannot sudo on > the box. > On the other hand I personally am an operator on the virtual box, i can > sudo with a password ( which ist nicely handled by fabric, by the way, > thanks a lot for this great work). Due to the nature of things there are > some jobs which have to be done as root, so I need a clean way to switch > between the user 'plone' and the user 'norbertk' (me) in the fabric file. > > Unfortunately I am not able to figure this out. A pure fabric 'sudo' can > not handle get and put operations, as far as I know. Can with and settings > do the job ? If yes, I would like to see an example. At the moment I copy > the env and change that, but even this does not work nicely with get/put I > use version 1.0. . > > > Thanks for listening ! > > Norbert > > > _______________________________________________ > Fab-user mailing list > Fab-user@nongnu.org > http://lists.nongnu.org/mailman/listinfo/fab-user > >
_______________________________________________ Fab-user mailing list Fab-user@nongnu.org http://lists.nongnu.org/mailman/listinfo/fab-user