%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/esxdatacenter.pyo

�
���^c@@s~dZddlmZmZmZddlZddlmZddlZ	ej
e�ZiZ
d�Zd�Zd�ZdS(u�
Salt states to create and manage VMware vSphere datacenters (datacenters).

:codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstaley.com>`

Dependencies
============

- pyVmomi Python Module

States
======

datacenter_configured
---------------------

Makes sure a datacenter exists and is correctly configured.

If the state is run by an ``esxdatacenter`` minion, the name of the datacenter
is retrieved from the proxy details, otherwise the datacenter has the same name
as the state.

Supported proxies: esxdatacenter


Example:

1. Make sure that a datacenter named ``target_dc`` exists on the vCenter, using a
``esxdatacenter`` proxy:

Proxy minion configuration (connects passthrough to the vCenter):

.. code-block:: yaml
    proxy:
      proxytype: esxdatacenter
      datacenter: target_dc
      vcenter: vcenter.fake.com
      mechanism: sspi
      domain: fake.com
      principal: host

State configuration:

.. code-block:: yaml

    datacenter_state:
      esxdatacenter.datacenter_configured
i(tabsolute_importtprint_functiontunicode_literalsN(tsixcC@sdS(Nu
esxdatacenter((((s=/usr/lib/python2.7/site-packages/salt/states/esxdatacenter.pyt__virtual__@scC@stS(N(tTrue(tlow((s=/usr/lib/python2.7/site-packages/salt/states/esxdatacenter.pytmod_initDscC@s/td�}|dkr-td�d}n|}tjdj|��i|d6id6dd6d	d
6}g}d}y6td�}tdd
|gd|�}|s<tdr�|jdj|��n=tjdj|��td||�|jdj|��tj|d�|djii|d6d6�n'|jdj|��tj|d�td|�dj	|�|d
<tdr�|dr�dnt
|d<|SWn{tjj
k
r*}tjdj|��|r�td|�n|jitdstndd6tj|�d
6�|SXdS(u\
    Makes sure a datacenter exists.

    If the state is run by an ``esxdatacenter`` minion, the name of the
    datacenter is retrieved from the proxy details, otherwise the datacenter
    has the same name as the state.

    Supported proxies: esxdatacenter

    name:
        Datacenter name. Ignored if the proxytype is ``esxdatacenter``.
    uvsphere.get_proxy_typeu
esxdatacenteruesxdatacenter.get_detailsu
datacenteru2Running datacenter_configured for datacenter '{0}'unameuchangesuresultuDefaultucommentu&vsphere.get_service_instance_via_proxyu"vsphere.list_datacenters_via_proxytdatacenter_namestservice_instanceutestu#State will create datacenter '{0}'.uCreating datacenter '{0}'. uvsphere.create_datacenteruCreated datacenter '{0}'.i����unewu4Datacenter '{0}' already exists. Nothing to be done.uvsphere.disconnectu
u	Error: {}N(t__salt__tlogtinfotformattNonet__opts__tappendtdebugtupdatetjoinRtsaltt
exceptionstCommandExecutionErrorterrortFalseRt	text_type(tnamet
proxy_typetdc_nametrettcommentstsitdcstexc((s=/usr/lib/python2.7/site-packages/salt/states/esxdatacenter.pytdatacenter_configuredHsP








"
$	(t__doc__t
__future__RRRtloggingtsalt.extRtsalt.exceptionsRt	getLoggert__name__Rt
LOGIN_DETAILSRRR"(((s=/usr/lib/python2.7/site-packages/salt/states/esxdatacenter.pyt<module>1s		

Zerion Mini Shell 1.0