Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fabric and svn password

Tags:

python

svn

fabric

Assuming that I cannot run something like this with Fabric:

run("svn update --password 'password' .")

how's the proper way to pass to Fabric the password for the remote interactive command line?

The problem is that the repo is checked out as svn+ssh and I don't have a http/https/svn option

like image 797
hyperboreean Avatar asked Apr 01 '10 15:04

hyperboreean


2 Answers

Try SSHkey. It allows you to connect to the server without password. In this case, you will have to setup a sshkey between your remote server and the repo.

At remote server: Generate key pair

 $ ssh-keygen -t dsa

Leave the passphase empty! This will generate 2 files

  • ~/.ssh/id_dsa (private key)
  • ~/.ssh/id_dsa.pub (public key)

Then, append the content in id_dsa.pub to ~/.ssh/authorized_keys at repo server.

Your remote server will be able to update the source tree without any password required.

like image 109
Bird Avatar answered Oct 21 '22 09:10

Bird


If yout just want to hide your password from log, you can use something like this:

from fabric.state import output

def xrun(command, hidden='', *args, **kwargs):
    old_state = output.running
    output.running = False
    print '[%s] run: %s' % (env.host_string, command)
    run(command + hidden, *args, **kwargs)
    output.running = command

xrun('svn update', '--password "your password"')
like image 41
Luka Zakrajšek Avatar answered Oct 21 '22 10:10

Luka Zakrajšek