%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZyddljjj	Z
eZWne
k
rhZeZnXeje�Zd�Zdd�Zd�ZdS(u�
Use Openstack Neutron data as a Pillar source. Will list all networks listed
inside of Neutron, to all minions.

.. versionadded:: 2015.5.1

:depends:  - python-neutronclient

A keystone profile must be used for the pillar to work (no generic keystone
configuration here). For example:

.. code-block:: yaml

    my openstack_config:
      keystone.user: 'admin'
      keystone.password: 'password'
      keystone.tenant: 'admin'
      keystone.auth_url: 'http://127.0.0.1:5000/v2.0/'
      keystone.region_name: 'RegionOne'
      keystone.service_type: 'network'

After the profile is created, configure the external pillar system to use it.

.. code-block:: yaml

    ext_pillar:
      - neutron: my_openstack_config

Using these configuration profiles, multiple neutron sources may also be used:

.. code-block:: yaml

    ext_pillar:
      - neutron: my_openstack_config
      - neutron: my_other_openstack_config

By default, these networks will be returned as a pillar item called
``networks``. In order to have them returned under a different name, add the
name after the Keystone profile name:

    ext_pillar:
      - neutron: my_openstack_config neutron_networks
i(tabsolute_importtprint_functiontunicode_literalsNcC@stS(u:
    Only return if python-neutronclient is installed
    (tHAS_NEUTRON(((s7/usr/lib/python2.7/site-packages/salt/pillar/neutron.pyt__virtual__=scC@smtd|�}i|dd6|dd6|dd6|dd	6|jd
d�d6|dd
6}tj|�S(u$
    Set up neutron credentials
    u
config.optionu
keystone.useruusernameukeystone.passwordupasswordukeystone.tenantutenant_nameukeystone.auth_urluauth_urlukeystone.region_nameuregion_nameukeystone.service_typeuservice_typeN(t__salt__tgettNonetsuoneutSaltNeutron(tprofiletcredentialstkwargs((s7/usr/lib/python2.7/site-packages/salt/pillar/neutron.pyt_authDsc	C@s�|j�}d}|dr)|d}nt|�}i}|j�}x |dD]}|||d<qRWt|�dkr�|jd�ni||d6S(u$
    Check neutron for all data
    iunetworksunameiiN(tsplitRR
t
list_networkstlentappend(	t	minion_idtpillartconftcompsR
tconntrettnetworkstnetwork((s7/usr/lib/python2.7/site-packages/salt/pillar/neutron.pyt
ext_pillarUs

(t__doc__t
__future__RRRtloggingtsalt.utils.openstack.neutrontutilst	openstacktneutronRtTrueRt	NameErrortexctFalset	getLoggert__name__tlogRRR
R(((s7/usr/lib/python2.7/site-packages/salt/pillar/neutron.pyt<module>,s

	

Zerion Mini Shell 1.0