HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/pillar/__pycache__/neutron.cpython-310.pyc
o

�N�g�	�
@s~dZddlZzddlmmmZdZWney*Z	zdZWYdZ	[	ndZ	[	wwe�
e�Zdd�Z
ddd�Zd	d
�ZdS)a�
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
�NTFcCstS)z:
    Only return if python-neutronclient is installed
    )�HAS_NEUTRON�rr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/pillar/neutron.py�__virtual__:srcCsJtd|�}|d|d|d|d|�dd�|dd	�}tjd
i|��S)z$
    Set up neutron credentials
    z
config.optionz
keystone.userzkeystone.passwordzkeystone.tenantzkeystone.auth_urlzkeystone.region_nameNzkeystone.service_type)�username�passwordZtenant_nameZauth_urlZregion_nameZservice_typer)Z__salt__�get�suoneuZSaltNeutron)�profileZcredentials�kwargsrrr�_authAs
�	rc	Csl|��}d}|dr|d}t|�}i}|��}|dD]}|||d<qt|�dkr0|�d�|d|iS)z$
    Check neutron for all data
    Nr�networks�name��)�splitrZ
list_networks�len�append)	Z	minion_idZpillarZconf�compsr
�conn�retr
�networkrrr�
ext_pillarRs
r)N)�__doc__�loggingZsalt.utils.openstack.neutron�utilsZ	openstackZneutronr	r�	NameError�exc�	getLogger�__name__�logrrrrrrr�<module>s,��