[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] using run on a machine that doesn't have /bin/bash
From: |
Christian Vest Hansen |
Subject: |
Re: [Fab-user] using run on a machine that doesn't have /bin/bash |
Date: |
Fri, 21 Nov 2008 20:24:39 +0100 |
Oh my.... That's a bug.
I can't think of any way to fix that other than dropping the eagerness
of the standard python string interpolation. This in turn introduces
the possibility of _lazy_format() returning strings with unresolved
placeholders.
What does the rest of the list think about this fix?
[PATCH] Don't resolve standard python string interpolation eagerly.
This fixes a bug that makes it impossible to set the fab_shell
variable, but in turn
make it possible for _lazy_format() to return strings with unresolved
placeholders.
---
fabric.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fabric.py b/fabric.py
index 609273e..36de95c 100644
--- a/fabric.py
+++ b/fabric.py
@@ -95,7 +95,7 @@ class Configuration(dict):
self[key] = value
def __setitem__(self, key, value):
if isinstance(value, types.StringTypes):
- value = (value % self)
+ value = value
dict.__setitem__(self, key, value)
def __call__(self, **kwargs):
for k, v in kwargs.items():
--
1.6.0.1
On Fri, Nov 21, 2008 at 7:48 PM, Don Jackson
<address@hidden> wrote:
> Yes. It's called the `fab_shell` variable, and it is by default
> defined like this:
>
> /bin/bash -l -c "%s"
>
> That helps, but I'm still doing something wrong:
> set(
> fab_hosts = ['svn01'],
> )
> set(
> fab_shell = '/bin/sh -l -c "%s"'
> )
> def pwd():
> "prints cwd"
> run("pwd")
>
> fab pwd
>
>
> Fabric v. 0.0.9, Copyright (C) 2008 Christian Vest Hansen.
> Fabric comes with ABSOLUTELY NO WARRANTY; for details type `fab
> warranty'.
> This is free software, and you are welcome to redistribute it
> under certain conditions; type `fab license' for details.
> Running pwd...
> Logging into the following hosts as dcj:
> svn01
> [svn01] run: pwd
> [svn01] err: /bin/sh: {fab_author:: not found
> Error: The run operation failed on svn01.
>
> On Fri, Nov 21, 2008 at 7:01 AM, Don Jackson
> <address@hidden> wrote:
>>
>> Doesn't seem to work.
>>
>> $ cat fabfile
>> set(
>> fab_hosts = ['svn01'],
>> )
>>
>> def pwd():
>> "prints cwd"
>> run("pwd")
>>
>> $ fab pwd
>> Fabric v. 0.0.9, Copyright (C) 2008 Christian Vest Hansen.
>> Fabric comes with ABSOLUTELY NO WARRANTY; for details type `fab
>> warranty'.
>> This is free software, and you are welcome to redistribute it
>> under certain conditions; type `fab license' for details.
>>
>> Running pwd...
>> Logging into the following hosts as dcj:
>> svn01
>> [svn01] run: pwd
>> [svn01] err: ksh: /bin/bash: not found
>> Error: The run operation failed on svn01.
>>
>> Is there a variable I can set that will make fabric use another shell?
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>
>
--
Venlig hilsen / Kind regards,
Christian Vest Hansen.
0001-Don-t-resolve-standard-python-string-interpolation-e.patch
Description: Binary data