fabric/fabric — pull request #746 by flypunk (2012-10-06 18:01:56+00:00)
Title: A patch for passing private key object to fabric api

It is useful in situations where fabric api is used as a library
for other tools.

An example of client code that uses this patch:

from StringIO import StringIO
import fabric.api as fapi
from paramiko.rsakey import RSAKey

private_key_string = '''-----BEGIN RSA PRIVATE KEY-----\n
PRIVATE_KEY_CONTENT_GOES_HERE\n
-----END RSA PRIVATE KEY-----'''

private_key_file_object = StringIO(private_key_string)
key = RSAKey(file_obj=private_key_file_object)
fapi.env.pkey = key
fapi.env.host_string='root@localhost'
fapi.run ('ls')