Looking at each function

The file server that we will be writing will be based on SFTP. Because SFTP calls can be expensive to make, we will use a caching implementation that relies on a popular Python library called Paramiko to retrieve files. For simplicity, we will only allow one SFTP server to be configured, but if you find yourself using this module, you may want to consider allowing multiple endpoints to be configured.

Setting up our module

Before we go over the functions that are used, we start setting up the module itself. We will implement a few functions that provide objects that we will use throughout the rest of our module:

''' The backend for serving files from an SFTP account. To enable, add ``sftp`` to the :conf_master:`fileserver_backend` ...

Get Extending SaltStack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.