%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlmZddlmZddlj	j
Z
dZdZd�Z
dddddded	�Zddded
�Zd�Zd�Zd
�ZdS(uz
Manage LXD profiles.

.. versionadded:: 2019.2.0

.. note:

    - `pylxd`_ version 2 is required to let this work,
      currently only available via pip.

        To install on Ubuntu:

        $ apt-get install libssl-dev python-pip
        $ pip install -U pylxd

    - you need lxd installed on the minion
      for the init() and version() methods.

    - for the config_get() and config_get() methods
      you need to have lxd-client installed.

.. _pylxd: https://github.com/lxc/pylxd/blob/master/doc/source/installation.rst

:maintainer: René Jochum <rene@jochums.at>
:maturity: new
:depends: python-pylxd
:platform: Linux
i(tabsolute_importtprint_functiontunicode_literals(tCommandExecutionError(tSaltInvocationErrorNurestructuredtext enulxd_profilecC@sdtkrtStS(u>
    Only load if the lxd module is available in __salt__
    ulxd.version(t__salt__t__virtualname__tFalse(((s;/usr/lib/python2.7/site-packages/salt/states/lxd_profile.pyt__virtual__,sc
	C@s�i	|d6|d6|d6|d6|d6|d6|d6|d6id	6}d}	y&td
|||||dt�}	Wn8tk
r�}
t|tj|
��Stk
r�}
nX|dkr�tj�}n|	dkr�tdr
d
j	|�}i|d6|d	<t
||�Sy'td||||||||�Wn&tk
rY}
t|tj|
��SXdj	|�}i|d6|d	<t||�Std||�\}}tj|	j�tj|�kr�dj	|	j|�|d	d<||	_ntd|	||td�}|d	j
|�|d	s/t|d�StdrOt
|dj	|��Sytd|	�Wn&tk
r�}
t|tj|
��SXt|dj	t|d	j����S(u=
    Creates or updates LXD profiles

    name :
        The name of the profile to create/update

    description :
        A description string

    config :
        A config dict or None (None = unset).

        Can also be a list:
            [{'key': 'boot.autostart', 'value': 1},
             {'key': 'security.privileged', 'value': '1'}]

    devices :
        A device dict or None (None = unset).

    remote_addr :
        An URL to a remote Server, you also have to give cert and key if you
        provide remote_addr!

        Examples:
            https://myserver.lan:8443
            /var/lib/mysocket.sock

    cert :
        PEM Formatted SSL Zertifikate.

        Examples:
            ~/.config/lxc/client.crt

    key :
        PEM Formatted SSL Key.

        Examples:
            ~/.config/lxc/client.key

    verify_cert : True
        Wherever to verify the cert, this is by default True
        but in the most cases you want to set it off as LXD
        normaly uses self-signed certificates.

    See the `lxd-docs`_ for the details about the config and devices dicts.
    See the `requests-docs` for the SSL stuff.

    .. _lxd-docs: https://github.com/lxc/lxd/blob/master/doc/rest-api.md#post-10
    .. _requests-docs: http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification  # noqa
    unameudescriptionuconfigudevicesuremote_addrucertukeyuverify_certuchangesulxd.profile_gett_rawutestuWould create the profile "{0}"ucreatedulxd.profile_createuProfile "{0}" has been createdulxd.normalize_input_valuesu)Description changed, from "{0}" to "{1}".ulxd.sync_config_devicesu
No changesu Profile "{0}" would get changed.ulxd.pylxd_save_objectu{0} changesN(tNoneRtTrueRt_errortsixt	text_typeRt__opts__tformatt
_unchangedt_successtdescriptiontupdatetlentkeys(
tnameRtconfigtdevicestremote_addrtcerttkeytverify_certtrettprofiletetmsgtchanges((s;/usr/lib/python2.7/site-packages/salt/states/lxd_profile.pytpresent3sz4



!


cC@spi|d6|d6|d6|d6|d6id6}tdr�ytd|||||�WnKtk
r�}t|tj|��Stk
r�}t|d	j|��SXid
j|�d6|d<t||dd�Sytd|||||�WnKtk
r}t|tj|��Stk
r@}t|d	j|��SXid
j|�d6|d<t||dd�S(u�
    Ensure a LXD profile is not present, removing it if present.

    name :
        The name of the profile to remove.

    remote_addr :
        An URL to a remote Server, you also have to give cert and key if you
        provide remote_addr!

        Examples:
            https://myserver.lan:8443
            /var/lib/mysocket.sock

    cert :
        PEM Formatted SSL Zertifikate.

        Examples:
            ~/.config/lxc/client.crt

    key :
        PEM Formatted SSL Key.

        Examples:
            ~/.config/lxc/client.key

    verify_cert : True
        Wherever to verify the cert, this is by default True
        but in the most cases you want to set it off as LXD
        normaly uses self-signed certificates.

    See the `requests-docs` for the SSL stuff.

    .. _requests-docs: http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification  # noqa
    unameuremote_addrucertukeyuverify_certuchangesutestulxd.profile_getuProfile "{0}" not found.u Profile "{0}" would get deleted.uremovedulxd.profile_deleteuProfile "{0}" has been deleted.(	RRRRR
RRRR(RRRRRRR ((s;/usr/lib/python2.7/site-packages/salt/states/lxd_profile.pytabsent�s8%

cC@s1t|d<||d<d|kr-i|d<n|S(Nuresultucommentuchanges(R(Rtsuccess_msg((s;/usr/lib/python2.7/site-packages/salt/states/lxd_profile.pyRs



cC@s1d|d<||d<d|kr-i|d<n|S(Nuresultucommentuchanges(R
(RR!((s;/usr/lib/python2.7/site-packages/salt/states/lxd_profile.pyRs



cC@s1t|d<||d<d|kr-i|d<n|S(Nuresultucommentuchanges(R(Rterr_msg((s;/usr/lib/python2.7/site-packages/salt/states/lxd_profile.pyR$s



(t__doc__t
__future__RRRtsalt.exceptionsRRtsalt.ext.sixtextR
t
__docformat__RRR
RR#R$RRR(((s;/usr/lib/python2.7/site-packages/salt/states/lxd_profile.pyt<module>s		�P		

Zerion Mini Shell 1.0