%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/sdb/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/sdb/env.pyc

�
���^c@@s`dZddlmZmZmZddlZidd6Zd�Zdd�Z	dd�Z
dS(	u�
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

i(tabsolute_importtprint_functiontunicode_literalsNusetuset_cC@stS(u
    Always load
    (tTrue(((s0/usr/lib/python2.7/site-packages/salt/sdb/env.pyt__virtual__FscC@stjj||�S(u
    Set a key/value pair
    (tostenviront
setdefault(tkeytvaluetprofile((s0/usr/lib/python2.7/site-packages/salt/sdb/env.pytset_MscC@stjj|�S(u
    Get a value
    (RRtget(RR
((s0/usr/lib/python2.7/site-packages/salt/sdb/env.pyRUs(t__doc__t
__future__RRRRt__func_alias__RtNoneRR(((s0/usr/lib/python2.7/site-packages/salt/sdb/env.pyt<module>;s
	

Zerion Mini Shell 1.0