Base Functions

argyle.base contains functions which extend the Fabric api to make the rest of the Argyle framework work.

sshagent_run(cmd)

The base ssh library paramiko and hence Fabric does not support SSH Agent forwarding. However, using agent forwarding can be helpful for accessing private repositories (such as hg/git) using ssh without having to generate and allow the ssh key for the server on the repository. To use this function you must enable SSH forwarding on your system.:

ForwardAgent yes

This code is based on code from Lincoln Loop. For more info you can see the Fabric issue and paramiko issue for adding support for agent forwarding.

Note

This issue has been fixed in Fabric 1.4.

upload_template(filename, destination, context=None, use_sudo=False, backup=True, mode=None)

Fabric comes with support for uploading files using a template. See fabric.contrib.files.upload_template. With this you can use either Python string formatting or Jinja2. Argyle uses this same idea but with a few differences:

  1. All templates use Jinja2.
  2. The current Fabric environment is always passed into the template context.
  3. You can pass list of template names. The first matched template will be used.

Argyle ships with templates which are loaded using jinja2.PackageLoader. You can override these template by defining env.ARGYLE_TEMPLATE_DIRS as a tuple of template locations.

Project Versions

Previous topic

Motivation

Next topic

System Functions

This Page