Hello Jacqueline,

The return code of 127 you're getting means that the command was not
found.  I suspect the path to this command is being included in your
path by the shell environment, so when you use "shell=False" you're
excluding that from your path.  Try using the full path to that
executable (use `which facter` to find it) and your should not have
further issues.

--Brandon

On Wed, Jan 18, 2012 at 4:30 PM, Jacqueline Atkins
<[email protected]> wrote:
> Actually, I was not clear when describing the issue.  The problem is
> not sudo but rather with the shell.
>
> When I use the following, shell= True, this works as expected on Solaris.
> run('facter|grep serial', shell=True)
>
> However, I work in a heterogeneous environment that includes AIX and
> if I do not set shell=False, the output from AIX contains control
> characters, etc.
>
> Any ideas would be greatly appreciated!!
>
> Thank you
>
> On Wed, Jan 18, 2012 at 4:13 PM, Jacqueline Atkins
> <[email protected]> wrote:
>> Hi Everyone;
>>
>> I have run into a peculiar issue that  is stumping me.
>>
>> When using sudo to execute a command on Solaris hosts, I get the
>> following error:
>>
>> [blvm-client3] out: bash: sudo: command not found
>> Warning: sudo() encountered an error (return code 127) while executing
>> 'facter serialnumber'
>>
>> Here is the code in my fabfile:
>>  sudo('facter serialnumber', shell=False)
>>
>> However, the command is executable locally.
>>
>>
>> Any advice would be greatly appreciated!
>> Thank you in advance!
>>
>> --
>> Jacqueline G. Atkins
>>
>> "To whom much is given, much will be required..."  Luke 12:48
>>
>> "“People, even more than things, have to be restored, renewed,
>> revived, reclaimed, and redeemed; never throw out anyone.” Audrey
>> Hepburn
>>
>> "....I am not going to be unnecessarily buoyed or depressed by someone
>> else's experience.  I have my own fight to fight" ..... Elizabeth
>> Edwards
>
>
>
> --
> Jacqueline G. Atkins
>
> "To whom much is given, much will be required..."  Luke 12:48
>
> "“People, even more than things, have to be restored, renewed,
> revived, reclaimed, and redeemed; never throw out anyone.” Audrey
> Hepburn
>
> "....I am not going to be unnecessarily buoyed or depressed by someone
> else's experience.  I have my own fight to fight" ..... Elizabeth
> Edwards
>
> _______________________________________________
> Fab-user mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/fab-user

_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to