%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/neutron_secgroup_rule.pyc

�
���^c@@sVdZddlmZmZmZdZd�Zd�Zdd�Z	dd�Z
dS(	u�
Management of OpenStack Neutron Security Group Rules
====================================================

.. versionadded:: 2018.3.0

:depends: shade
:configuration: see :py:mod:`salt.modules.neutronng` for setup instructions

Example States

.. code-block:: yaml

    create security group rule:
      neutron_secgroup_rule.present:
        - name: security_group1
        - project_name: Project1
        - protocol: icmp

    delete security group:
      neutron_secgroup_rule.absent:
        - name_or_id: security_group1

    create security group with optional params:
      neutron_secgroup_rule.present:
        - name: security_group1
        - description: "Very Secure Security Group"
        - project_id: 1dcac318a83b4610b7a7f7ba01465548
i(tabsolute_importtprint_functiontunicode_literalsuneutron_secgroup_rulecC@sdtkrtStdfS(Nuneutronng.list_subnetsufThe neutronng execution module failed to load:                    shade python module is not available(t__salt__t__virtualname__tFalse(((sE/usr/lib/python2.7/site-packages/salt/states/neutron_secgroup_rule.pyt__virtual__%scC@sNt|j��j|j��}x&|D]}||||kr(tSq(WtS(uP
    Compare the common keys between security group rules against eachother
    (tsettkeystintersectionRtTrue(trule1trule2t
commonkeystkey((sE/usr/lib/python2.7/site-packages/salt/states/neutron_secgroup_rule.pyt
_rule_compare,s
!
c	K@s�i|d6id6td6dd6}td|�}td|�d|krd|d|d	<|d=ntd
d|d	�}|dkr�t|d<d|d<|Std
d|di|jd6�}|dkr�t|d<if|d<dj|�|d<|Sd}x0|dD]$}t||�tkr
t}q
q
W|dkr�tdtkrsd|d<||d<d|d<|S||d<td|�}||d<d|d<|S|S(u
    Ensure a security group rule exists

    defaults: port_range_min=None, port_range_max=None, protocol=None,
              remote_ip_prefix=None, remote_group_id=None, direction='ingress',
              ethertype='IPv4', project_id=None

    name
        Name of the security group to associate with this rule

    project_name
        Name of the project associated with the security group

    protocol
        The protocol that is matched by the security group rule.
        Valid values are None, tcp, udp, and icmp.

    unameuchangesuresultuucommentuargs.clean_kwargsuneutronng.setup_cloudsuproject_nameu
project_idukeystoneng.project_gettnameuProject does not existuneutronng.security_group_gettfiltersu	tenant_idu Security Group does not exist {}usecurity_group_rulesutestu$Security Group rule will be created.usecgroup_name_or_idu$neutronng.security_group_rule_createuCreated security group ruleN(	R
t	__utils__RtNoneRtidtformatRt__opts__(	Rtauthtkwargstrettprojecttsecgrouptrule_existstruletnew_rule((sE/usr/lib/python2.7/site-packages/salt/states/neutron_secgroup_rule.pytpresent8sN
















cK@s%|d}i|d6id6td6dd6}td|�tdd	|d
i|dd6�}|dkrxd
|d<|Sd}x7|dD]+}t|i|d6�tkr�t}q�q�W|r!tdr�d|d<i|dd6|d<d|d<|Stdd|�||dd<d|d<n|S(u�
    Ensure a security group rule does not exist

    name
        name or id of the security group rule to delete

    rule_id
        uuid of the rule to delete

    project_id
        id of project to delete rule from
    urule_idunameuchangesuresultuucommentuneutronng.setup_cloudsuneutronng.security_group_getRRu
project_idu	tenant_idusecurity group does not existusecurity_group_rulesuidutestu$Security group rule will be deleted.u$neutronng.security_group_rule_deletetrule_iduDeleted security group ruleN(R
RRRR(RRRR RRRR((sE/usr/lib/python2.7/site-packages/salt/states/neutron_secgroup_rule.pytabsent�s4









N(t__doc__t
__future__RRRRRRRRR!(((sE/usr/lib/python2.7/site-packages/salt/states/neutron_secgroup_rule.pyt<module>s		K

Zerion Mini Shell 1.0