fabric

Fabric auto-login in Windows

Relevant question: http://stackoverflow.com/questions/2339735/fabric-password I configured Putty to login with private-public keys (no password) using this guide: http://www.codelathe.com/blog/index.php/2009/02/20/ssh-without-password-using-putty/ It works. Now I want to run Fabric with no password prompt. This does not work and I...

Stand-alone fabfile for fabric?

Is it possible to make the fabfile stand-alone? I'm not very fond of running the external tool 'fab'. If I manage to get the fabfile standalone I can run the file from within the (Eclipse / Pydev) IDE, easily debug it, use project configurations and paths etc. Why doesn't this work: from fabric.api import run def host_type(): run('...

Get the current value of env.hosts list with Python Fabric Library

Hello, I've got this code (foo and bar are local servers): env.hosts = ['foo', 'bar'] def mytask(): print(env.hosts[0]) Which, of course prints foo every iteration. As you probably know, Fabric iterates through the env.hosts list and executes mytask() on each of them this way: fab mytask does task is executed on foo task is...

python win32api in cygwin-1.75

Hello, when i run fabric-0.9.1 in cygwin, it say following error: $ fab test.py Traceback (most recent call last): File "/usr/bin/fab", line 8, in <module> load_entry_point('Fabric==0.9.1', 'console_scripts', 'fab')() File "/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 318, in load_ent...

Disconnecting from host with Python Fabric when using the API

The website says: Closing connections: Fabric’s connection cache never closes connections itself – it leaves this up to whatever is using it. The fab tool does this bookkeeping for you: it iterates over all open connections and closes them just before it exits (regardless of whether the tasks failed or not.) Libr...

Django Deployment: Handling data in database

Right now I am using git for Django deployment which seems satisfying to me. My only problem is still how to handle the data in the database properly. Eg. I need often to edit data coming from the prodution site locally and put the data back on the production site (please note I'm talking about data changes and not schema migrations!). I...

Fabric: call run() for an explicit host

I'd like to use fabric as a tool to gather all server loads and process the values afterward, I thought of something like this: from fabric.api import run for servername in servernames: load_str = run('cat /proc/loadavg | cut -d' ' -f1', host=servername) but fabric doesn't allow me to specify the hostname this way, I found this I...

How to hide the password in fabric when the command is printed out?

Say I have a fabfile.py that looks like this: def setup(): pwd = getpass('mysql password: ') run('mysql -umoo -p%s something' % pwd) The output of this is: [host] run: mysql -umoo -pTheActualPassword Is there a way to make the output look like this? [host] run: mysql -umoo -p******* Note: ...

hg pull from bitbucket using fabric

I'm trying to use fabric to deploy a Django project and I get this error when I run hg pull: [myusername.webfactional.com] run: hg pull [myusername.webfactional.com] out: remote: Warning: Permanently added the RSA host key for IP address '207.223.240.181' to the list of known hosts. [myusername.webfactional.com] out: remote: Permission ...

How to dynamically create module level functions from methods in a class

I am trying to dynamically create module level functions from the methods in a class. So for every method in a class, I want to create a function with the same name which creates an instance of the class and then calls the method. The reason I want to do this is so I can take an object-oriented approach to creating Fabric files. Since F...

Can I prevent fabric from prompting me for a sudo password?

I am using Fabric to run commands on a remote server. The user with which I connect on that server has some sudo privileges, and does not require a password to use these privileges. When SSH'ing into the server, I can run sudo blah and the command executes without prompting for a password. When I try to run the same command via Fabric's ...

Pre-interpret Django site at deployment time

I deploy Django apps using a fabric script that checks out a copy of my project and when everything is in place the source is symlinked and the web server is reloaded (guessing this is a typical approach). My concern is that the first time the site gets hit after deployment all the python scripts need to be re-interpreted. I have some ...

Import from a Django project with a different top-level folder name

I recently setup a deployment solution for my Django project using Fabric. The basic workflow being: Check out the latest source from git on the server. Copy it to a 'releases' directory and add a timestamp to the directory name. Update the 'current' symlink to point to the latest build. This works just fine, only problem is, since t...

How to continue the task when fabric meet an error

When i define a task run on several remote server, if the task run on server one and meet a error, fabric will stop and Abort the task. But I want to make fabric to ignore the error and run the task on next server. how to make it? for example: $ fab site1_service_gw [site1rpt1] Executing task 'site1_service_gw' [site1fep1] run: e...

Asp.net mvc app running in Azure Dev. Fabric and RequireHttps attribute

I have a Asp.Net MVC that runs on Azure Dev. Fabric. I have a few pages that need to run under SSL, so I marked the corresponding controllers/actions with requiresHTTPs attribute. Now when I run the app, as soon as I navigate to pages that redirect to https, IIS throws 404 error. I created a self-signed certificate for IIS, thus https://...

fabric local command usage problem

i want execute a command need sudo in local machine,so as the doc say i use the local command, but it will ask me input the password,how can i avoid this,is there some place can save my local machine password local('sudo /etc/init.d/tomcat6 start',capture=True) ...

python fabric run command how to abort

run("if [ -d data.bak ];then mv data.bak data;fi;") sudo('....') sudo('') i use fabric deploy my project to web,and i want to find a way to didn't do the left command,if didn't find data.bak directory,so is there some way to achieve this on fabric ...