Python fabric cant be executed from python using subproccess -


in python trying execute fabfile , ,i below error subproccess output. installed fabric using easy install. if run code command line works. python no go. assume there issue how using popen command?

/bin/sh: 1: fab: not found 

below how start fabric python:

cmd = """fab -h 111.111.111.111 aws_bootstrap initial_chef_run:aws_server.json,aws-test,development -w """ os.chdir(fab_path) #change dir fabfile located p = subprocess.popen(cmd, shell=true,stderr=subprocess.stdout,stdout=subprocess.pipe) 

ps added below popen below error:

 executable="/bin/bash"    /bin/bash: fab: command not found 

from command line below means terminal can find fab.

 fab  fatal error: couldn't find fabfiles!  remember -f can used specify fabfile path, , use -h help.  aborting. 

try use whole path fab. path fab on system, can use which fab.

however, can't think of reason why calling fab python might better using execute function of fab:

from fabric.tasks import execute import my_fabfile  r = execute(my_fabfile.aws_bootstrap, hosts=["root@%s" % '111.111.111.111]) 

return value r contain dict hosts key(s).


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -