File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/botomod.cpython-310.pyc
Back
o ;j� � @ s: d Z ddlZddlZddlZddlmZ ddlZddlZddl Zddl mZ ddlm Z zddlZddlZe�d��ej� dZW n eyL dZY nw e�e�ZdadZejj�� Ze�d i �Zd d� Zdd � Z d!dd�Z!dd� Z" d"dd�Z#d#dd�Z$dd� Z%d$dd�Z&dd� Z'd%dd�Z(dd � Z)dS )&a� Boto Common Utils ================= Note: This module depends on the dicts packed by the loader and, therefore, must be accessed via the loader or from the __utils__ dict. This module provides common functionality for the boto execution modules. The expected usage is to call `assign_funcs` from the `__virtual__` function of the module. This will bring properly initialized partials of `_get_conn` and `_cache_id` into the module's namespace. Example Usage: .. code-block:: python def __virtual__(): __utils__['boto.assign_funcs'](__name__, 'vpc') def test(): conn = _get_conn() vpc_id = _cache_id('test-vpc') .. versionadded:: 2015.8.0 � N)�partial)�SaltInvocationError)�minion_mods�botoTF�__context__c C s, t jjjdd�} | du rtstt�atS | S )zg Only load if boto libraries exist and if boto libraries are greater than a given version. F)Zcheck_boto3T)�salt�utilsZversionsZcheck_boto_reqs�__salt__r Z__opts__�__virtualname__)Zhas_boto_requirements� r �F/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/botomod.py�__virtual__<