File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/sdb/__pycache__/env.cpython-310.pyc
Back
o ;j� � @ s4 d Z ddlZddiZdd� Zd dd�Zd dd �ZdS )a� Environment sdb Module :maintainer: SaltStack :maturity: New :depends: None :platform: all This module allows access to environment variables using an ``sdb://`` URI. Example configuration for this module: .. code-block:: yaml osenv: driver: env WARNING: -------- OS environment variables will be available to read via SDB. Please make sure you don't have any sensitive data in your environment variables!! Example usage of sdb env module: .. code-block:: jinja set some env var: cmd.run: - name: echo {{ salt['sdb.set']('sdb://osenv/foo', 'bar') }} - order: 1 {% if salt['sdb.get']('sdb://osenv/foo') == 'bar' %} always-changes-and-succeeds: test.succeed_with_changes: - name: foo {% else %} always-changes-and-fails: test.fail_with_changes: - name: foo {% endif %} The above example will return success. The ``env`` sdb module can also be used with salt cloud. Assuming you have exported the environment variable named ``compute`` (and have ``osenv`` defined). The example below will look for the salt cloud config key ``compute_name`` in the environment: .. code-block:: yaml my-openstack-config: compute_name: sdb://osenv/compute ..snip � N�set_�setc C s dS )z Always load T� r r r �@/opt/saltstack/salt/lib/python3.10/site-packages/salt/sdb/env.py�__virtual__A s r c C s t j�| |�S )z Set a key/value pair )�os�environ� setdefault)�key�value�profiler r r r H s c C s t j�| �S )z Get a value )r r �get)r r r r r r P s r )N)�__doc__r Z__func_alias__r r r r r r r �<module> s ;
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings