File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/fileserver/__pycache__/azurefs.cpython-310.pyc
Back
o ;j�4 � @ s d Z ddlZddlZddlZddlZddlZddlZddlZddl Zddl ZddlZddlZddl mZ zddlZeejj�ed�k rGed��dZW n eefyW dZY nw dZe�� Zd d � Zd dd �Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Z dd� Z!dd� Z"dd� Z#dS )!a� The backend for serving files from the Azure blob storage service. .. versionadded:: 2015.8.0 To enable, add ``azurefs`` to the :conf_master:`fileserver_backend` option in the Master config file. .. code-block:: yaml fileserver_backend: - azurefs Starting in Salt 2018.3.0, this fileserver requires the standalone Azure Storage SDK for Python. Theoretically any version >= v0.20.0 should work, but it was developed against the v0.33.0 version. Each storage container will be mapped to an environment. By default, containers will be mapped to the ``base`` environment. You can override this behavior with the ``saltenv`` configuration option. You can have an unlimited number of storage containers, and can have a storage container serve multiple environments, or have multiple storage containers mapped to the same environment. Normal first-found rules apply, and storage containers are searched in the order they are defined. You must have either an account_key or a sas_token defined for each container, if it is private. If you use a sas_token, it must have READ and LIST permissions. .. code-block:: yaml azurefs: - account_name: my_storage account_key: 'fNH9cRp0+qVIVYZ+5rnZAhHc9ycOUcJnHtzpfOr0W0sxrtL2KVLuMe1xDfLwmfed+JJInZaEdWVCPHD4d/oqeA==' container_name: my_container - account_name: my_storage sas_token: 'ss=b&sp=&sv=2015-07-08&sig=cohxXabx8FQdXsSEHyUXMjsSfNH2tZ2OB97Ou44pkRE%3D&srt=co&se=2017-04-18T21%3A38%3A01Z' container_name: my_dev_container saltenv: dev - account_name: my_storage container_name: my_public_container .. note:: Do not include the leading ? for sas_token if generated from the web � N)�Versionz0.20.0z+azure.storage.__version__ must be >= 0.20.0TF�azurefsc C s2 t td vrdS tsdS dtvrdS t� sdS dS )zQ Only load if defined in fileserver_backend and azure.storage is present Zfileserver_backendFr T)�__virtualname__�__opts__� HAS_AZURE�_validate_config� r r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/fileserver/azurefs.py�__virtual__M s r �basec K s� ddd�}t �dg �D ]D}|�dd�|krqtj�t|�| �}tj�|�rOtj� t | �sO||d<