%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/docker_volume.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZeje	�Z
dZd
Zd�Z
d�Zdded�Zdd	�ZdS(u�
Management of Docker volumes

.. versionadded:: 2017.7.0

:depends: docker_ Python module

.. note::
    Older releases of the Python bindings for Docker were called docker-py_ in
    PyPI. All releases of docker_, and releases of docker-py_ >= 1.6.0 are
    supported. These python bindings can easily be installed using
    :py:func:`pip.install <salt.modules.pip.install>`:

    .. code-block:: bash

        salt myminion pip.install docker

    To upgrade from docker-py_ to docker_, you must first uninstall docker-py_,
    and then install docker_:

    .. code-block:: bash

        salt myminion pip.uninstall docker-py
        salt myminion pip.install docker

.. _docker: https://pypi.python.org/pypi/docker
.. _docker-py: https://pypi.python.org/pypi/docker-py

These states were moved from the :mod:`docker <salt.states.docker>` state
module (formerly called **dockerng**) in the 2017.7.0 release.
i(tabsolute_importtprint_functiontunicode_literalsNu
docker_volumeumoby_volumecC@s#dtkrtSttjd�fS(u?
    Only load if the docker execution module is available
    udocker.version(t__salt__t__virtualname__tFalsetmissing_fun_string(((s=/usr/lib/python2.7/site-packages/salt/states/docker_volume.pyt__virtual__/scC@sUtd�d}|rQg|D]}|d|kr|^q}|rQ|dSndS(u'
    Find volume by name on minion
    udocker.volumesuVolumesuNameiN(RtNone(tnametdocker_volumestvtvolumes((s=/usr/lib/python2.7/site-packages/salt/states/docker_volume.pyt_find_volume8s)cC@sYi|d6id6td6dd6}tjjj|�rOtjjj|�}nt|�}|s�tdr�d|d<dj	|�|d<|Sy(t
d|d	|d
|�|dd<Wn*tk
r�}dj	||�|d<|SXt}||d<|Sn|dk	r8|d
|kr8|sUdj	||d
|�|d<tdrGdnt|d<|Stdr�d|d<dj	||�|d<|Syt
d|�|dd<Wn*tk
r�}dj	||�|d<|SXy(t
d|d	|d
|�|dd<Wn*tk
r }dj	||�|d<|SXt}||d<|Snt|d<dj	|�|d<|S(u6
    Ensure that a volume is present.

    .. versionadded:: 2015.8.4
    .. versionchanged:: 2015.8.6
        This state no longer deletes and re-creates a volume if the existing
        volume's driver does not match the ``driver`` parameter (unless the
        ``force`` parameter is set to ``True``).
    .. versionchanged:: 2017.7.0
        This state was renamed from **docker.volume_present** to **docker_volume.present**

    name
        Name of the volume

    driver
        Type of driver for that volume.  If ``None`` and the volume
        does not yet exist, the volume will be created using Docker's
        default driver.  If ``None`` and the volume does exist, this
        function does nothing, even if the existing volume's driver is
        not the Docker default driver.  (To ensure that an existing
        volume's driver matches the Docker default, you must
        explicitly name Docker's default driver here.)

    driver_opts
        Options for the volume driver

    force : False
        If the volume already exists but the existing volume's driver
        does not match the driver specified by the ``driver``
        parameter, this parameter controls whether the function errors
        out (if ``False``) or deletes and re-creates the volume (if
        ``True``).

        .. versionadded:: 2015.8.6

    Usage Examples:

    .. code-block:: yaml

        volume_foo:
          docker_volume.present


    .. code-block:: yaml

        volume_bar:
          docker_volume.present
            - name: bar
            - driver: local
            - driver_opts:
                foo: bar

    .. code-block:: yaml

        volume_bar:
          docker_volume.present
            - name: bar
            - driver: local
            - driver_opts:
                - foo: bar
                - option: value

    unameuchangesuresultuucommentutestu The volume '{0}' will be createdudocker.create_volumetdrivertdriver_optsucreatedu"Failed to create volume '{0}': {1}uDriverucDriver for existing volume '{0}' ('{1}') does not match specified driver ('{2}') and force is FalseuGThe volume '{0}' will be replaced with a new one using the driver '{1}'udocker.remove_volumeuremovedu"Failed to remove volume '{0}': {1}uVolume '{0}' already exists.N(
Rtsalttutilstdatatis_dictlisttrepack_dictlistR
t__opts__RtformatRt	ExceptiontTrue(R	RRtforcetrettvolumetexctresult((s=/usr/lib/python2.7/site-packages/salt/states/docker_volume.pytpresentEsh@



!


!

cC@s�i|d6id6td6dd6}t|�}|sUt|d<dj|�|d<|Sy&td|�|dd<t|d<Wn)tk
r�}d	j||�|d<nX|S(
uL
    Ensure that a volume is absent.

    .. versionadded:: 2015.8.4
    .. versionchanged:: 2017.7.0
        This state was renamed from **docker.volume_absent** to **docker_volume.absent**

    name
        Name of the volume

    Usage Examples:

    .. code-block:: yaml

        volume_foo:
          docker_volume.absent

    unameuchangesuresultuucommentuVolume '{0}' already absentudocker.remove_volumeuremovedu"Failed to remove volume '{0}': {1}(RR
RRRR(R	RRRR((s=/usr/lib/python2.7/site-packages/salt/states/docker_volume.pytabsent�s 


(umoby_volume(t__doc__t
__future__RRRtloggingtsalt.utils.dataRt	getLoggert__name__tlogRt__virtual_aliases__RR
RRRR(((s=/usr/lib/python2.7/site-packages/salt/states/docker_volume.pyt<module> s			
~

Zerion Mini Shell 1.0