|
From: | William Liu |
Subject: | Re: [Fab-user] using sudo and rm/mv |
Date: | Wed, 3 Dec 2008 23:27:28 -0800 |
Comments inline On Dec 2, 2008, at 11:26 AM, Christian Vest Hansen wrote:
On Mon, Dec 1, 2008 at 8:08 PM, William Liu <address@hidden> wrote:I've recently stumbled upon Fabric and its been a great tool. Things have been working great, but one slight problem. In my script, I have a fewcalls which do some filesystem manipulation, specifically removing adirectory (rm -fr olddir) and renaming (mv newdir olddir) -- I'm using'sudo' to do this on a remote machine.Even though on the remote machine, the call goes through (e.g. the directoryis removed), locally, I get an error saying the sudo operation failed(subsequent Socket closed). To get around this, I've simply used the 'fail' kwarg and set it to 'warn'. I was wondering if there was a specific reasonwhy this is happening, or if I'm doing something wrong -- thanks,Are you running Fabric on Windows? Because I have a feeling that there's a difference in how threading works on win32 vs. *nix, but I don't have access to a Windows box so I can't test that theory (or my code, for that matter).
I'm running it from Ubuntu (Hardy 8.04) to a remove machine also running Ubuntu (Hardy 8.04).
Appart from that, stuff like the version of paramiko, OSes, what SSH server you connect to, is good to know when trying to figure this one out. Also, the version of Fabric and some fabfile code with the shell output you get.
I installed paramkio via apt-get on Ubuntu so its 1.6.4-1.1 And using Fabric v. 0.0.9 Here's some sample fab code I used: def test_rm1(): set(fab_hosts = ['somehost.com'],) sudo('rm /foo.txt') def test_rm2(): set(fab_hosts = ['somehost.com'],) sudo('rm -fr foodir') Here's the associated output: Running test_rm1... Logging into the following hosts as foobar: somehost.com Password for address@hidden: [somehost.com] sudo: rm /foo.txt Error: The sudo operation failed on somehost.com: Socket is closed Running test_rm2... Logging into the following hosts as foobar: somehost.com Password for address@hidden: [somehost.com] sudo: rm -fr foo Error: The sudo operation failed on somehost.com: Socket is closed Thanks again for the help, -w
-w _______________________________________________ Fab-user mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/fab-user-- Venlig hilsen / Kind regards, Christian Vest Hansen.
[Prev in Thread] | Current Thread | [Next in Thread] |