Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Thin facade atop fabric

Project description


A façade atop fabric2


I have revisited Fabric (September 2018) to find it can handle multiple threads and multiple connections! This is great news: it makes all my automation faster!

Like with most APIs, I made a façade because Fabric is not congruent to my own programming conventions. This is not bad, just different: The domain I work in is slightly different than what the Fabric developers expect.

Here are the differences:

  • All stdout and strerr from the remote machine is annotated, and shunted, to the local logging module.
  • A few convenience methods are added:
    • conn.exists(path) - to test if a remote file exists
    • with conn.warn_only(): - context manager if you do not care if your commands fail
    • get(remote, local, use_sudo=False) - allows you to use tilde (~) on Windows to refer to home directory
    • put(local, remote, use_sudo=False) - similar to get, except copies files to remote
    • sudo(command) works with the cd() context manager
    • Result.__contains__() so checking for patterns in command output is simpler:
          result ="ls /data1", warn=True)
          not_found = "No` such file or directory" in result

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mo-fabric, version 3.30.19346
Filename, size File type Python version Upload date Hashes
Filename, size mo-fabric-3.30.19346.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page