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

�
���^c@@scdZddlmZmZmZddlmZd�Zdddde	d�Z
dd�ZdS(u#
Management of Open vSwitch ports.
i(tabsolute_importtprint_functiontunicode_literals(tsixcC@s
dtkS(uO
    Only make these states available if Open vSwitch module is available.
    uopenvswitch.port_add(t__salt__(((s@/usr/lib/python2.7/site-packages/salt/states/openvswitch_port.pyt__virtual__
sc@sKi�d6id6td6dd6�dK}|r[||kr[td	jtj|����ntd
|�}g�|r�td|��ni�dj|��d
<dj���d<dj�|��d<dj�|��d<iidj��d6dj|��d6�6�d<|r�d�d<|dkr�d�d<dj���d<dj��|��d <d!j��|��d"<d#j��|��d$<iid%j��|�d6d&j|���d6�6�d'<q�|dkr�d(�d)<d*j���|��d+<d,j���|��d-<d.j���|��d/<iid0j���|�d6d1j���|�d6�6�d2<q�|dkr�d3�ko�d4knr�d5tj��d6nd�d7<d8�d9<d:j���|�d7��d;<d<j���|�d7��d=<d>j���|�d7��d?<iid@j���|�d7�d6dAj���|�d7�d6�6�dB<q�n������fdC�}	������fdD�}
�������fdE�}tdFr|r�|dkrE|	��ds�dL�d<�d"�d<q�q|dkr�|��ds�dL�d<�d=�d<q�q|dkr�|
��ds�dL�d<�d-�d<q�q��kr�t�d<�d�d<qdL�d<�d�d<ndL�d<�d
�d<�S|r/|dkr�|	��ds,tdG|����}|r�t�d<�d"�d<�d'�d<q�t�d<�d$�d<q,qG|dkr(|��ds,tdH|�����}
|
r
t�d<�d=�d<�dB�d<q%t�d<�d?�d<q,qG|dkr�|
��ds,tdI|����}|r�t�d<�d-�d<�d2�d<q�t�d<�d/�d<q,qG��kr�t�d<�d�d<qGtdJ|��}|rt�d<�d�d<�d�d<qGt�d<�d�d<nt�d<�d
�d<�S(Mu�
    Ensures that the named port exists on bridge, eventually creates it.

    Args:
        name: The name of the port.
        bridge: The name of the bridge.
        tunnel_type: Optional type of interface to create, currently supports: vlan, vxlan and gre.
        id: Optional tunnel's key.
        remote: Remote endpoint's IP address.
        dst_port: Port to use when creating tunnelport in the switch.
        internal: Create an internal port if one does not exist

    unameuchangesuresultuucommentuvlanuvxlanugreu<The optional type argument must be one of these values: {0}.uopenvswitch.bridge_existsuopenvswitch.port_listuBridge {0} does not exist.ucomment_bridge_notexistsuPort {0} already exists.ucomment_port_existsuPort {0} created on bridge {1}.ucomment_port_createdu(Unable to create port {0} on bridge {1}.ucomment_port_notcreateduNo port named {0} present.uolduCreated port {1} on bridge {0}.unewuchanges_port_createduRemote is not valid ip address.ucomment_invalid_ipu$VLANs id must be between 0 and 4095.ucomment_vlan_invalid_idu%Could not find network interface {0}.ucomment_vlan_invalid_nameu>Port {0} with access to VLAN {1} already exists on bridge {2}.ucomment_vlan_port_existsu7Created port {0} with access to VLAN {1} on bridge {2}.ucomment_vlan_createdu@Unable to create port {0} with access to VLAN {1} on bridge {2}.ucomment_vlan_notcreateduHNo port named {0} with access to VLAN {1} present on bridge {2} present.u7Created port {1} with access to VLAN {2} on bridge {0}.uchanges_vlan_createdu4Id of GRE tunnel must be an unsigned 32-bit integer.ucomment_gre_invalid_iduUGRE tunnel interface {0} with rempte ip {1} and key {2} already exists on bridge {3}.ucomment_gre_interface_existsuOCreated GRE tunnel interface {0} with remote ip {1}  and key {2} on bridge {3}.ucomment_gre_createduWUnable to create GRE tunnel interface {0} with remote ip {1} and key {2} on bridge {3}.ucomment_gre_notcreateduQNo GRE tunnel interface {0} with remote ip {1} and key {2} on bridge {3} present.uNCreated GRE tunnel interface {0} with remote ip {1} and key {2} on bridge {3}.uchanges_gre_createdii��u
 (dst_portu)ucomment_dstportu6Id of VXLAN tunnel must be an unsigned 64-bit integer.ucomment_vxlan_invalid_iduZVXLAN tunnel interface {0} with rempte ip {1} and key {2} already exists on bridge {3}{4}.ucomment_vxlan_interface_existsuTCreated VXLAN tunnel interface {0} with remote ip {1}  and key {2} on bridge {3}{4}.ucomment_vxlan_createdu\Unable to create VXLAN tunnel interface {0} with remote ip {1} and key {2} on bridge {3}{4}.ucomment_vxlan_notcreateduVNo VXLAN tunnel interface {0} with remote ip {1} and key {2} on bridge {3}{4} present.uSCreated VXLAN tunnel interface {0} with remote ip {1} and key {2} on bridge {3}{4}.uchanges_vxlan_createdc	@s�td��}td�}d�ko4dknsTt�d<�d�d<n��r��|kr�t�d<�d�d<nd|r���kr�y5t|d��kr�t�d<�d	�d<nWq�ttfk
r�q�XndS(
Nuopenvswitch.port_get_tagunetwork.interfacesii�uresultucomment_vlan_invalid_iducommentucomment_vlan_invalid_nameucomment_vlan_port_exists(RtFalsetinttTruet
ValueErrortKeyError(ttagt
interfaces(tcommentstidtinternaltnamet	port_listtret(s@/usr/lib/python2.7/site-packages/salt/states/openvswitch_port.pyt_check_vlanks



c@std��}td��}d�ko7dknsWt�d<�d�d<n�td	��s�t�d<�d
�d<n�|r|r��krdtj��dtj��d
}y?|ddkr|d|krt�d<�d�d<nWqtk
rqXndS(Nu!openvswitch.interface_get_optionsuopenvswitch.interface_get_typeiii uresultucomment_gre_invalid_iducommentudig.check_ipucomment_invalid_ipu{key="u", remote_ip="u"}ugreucomment_gre_interface_existsI(RRRt	text_typeRR
(tinterface_optionstinterface_typetinterface_attroptions(R
RRRtremoteR(s@/usr/lib/python2.7/site-packages/salt/states/openvswitch_port.pyt
_check_gre}s 

( 

c	@s^td��}td��}d�ko7dknsWt�d<�d�d<ntd	��s�t�d<�d
�d<n�|rZ|rZ��krZd�ko�dknr�dtj��d
nd}dj|�tj��dtj��d}y?|ddkrB|d|krBt�d<�d�d<nWqZtk
rVqZXndS(Nu!openvswitch.interface_get_optionsuopenvswitch.interface_get_typeiii@uresultucomment_vxlan_invalid_iducommentudig.check_ipucomment_invalid_ipi��u
dst_port="u", uu
{{{0}key="u", remote_ip="u"}uvxlanucomment_vxlan_interface_existsl(RRRRtformatRR
(RRtopt_portR(R
tdst_portRRRRR(s@/usr/lib/python2.7/site-packages/salt/states/openvswitch_port.pyt_check_vxlan�s"

91 

utestuopenvswitch.port_create_vlanuopenvswitch.port_create_vxlanuopenvswitch.port_create_greuopenvswitch.port_add(uvlanuvxlanugreN(	Rt	TypeErrorRRRRt__opts__tNoneR(Rtbridgettunnel_typeRRRRttunnel_typest
bridge_existsRRRtport_create_vlantport_create_vxlantport_create_gretport_add((R
RRRRRRRs@/usr/lib/python2.7/site-packages/salt/states/openvswitch_port.pytpresents�"	


!=
+!






















cC@s9i|d6id6td6dd6}t}|r`td|�}|rWtd|�}qid}n	|g}i}dj|�|d	<d
j||�|d<dj|�|d
<dj|�|d<iidj|�d6dj|�d6|6|d<tdrd|r!|r!d|d<|d	|d<n?||krHt|d<|d|d<nd|d<|d
|d<|S|r�|r�t|d<|d	|d<n�||kr�t|d<|d|d<n�|r�tdd|d|�}ntdddd|�}|rt|d<|d
|d<|d|d<nt|d<|d|d<|S(u�
    Ensures that the named port exists on bridge, eventually deletes it.
    If bridge is not set, port is removed from  whatever bridge contains it.

    Args:
        name: The name of the port.
        bridge: The name of the bridge.

    unameuchangesuresultuucommentuopenvswitch.bridge_existsuopenvswitch.port_listuBridge {0} does not exist.ucomment_bridge_notexistsu&Port {0} does not exist on bridge {1}.ucomment_port_notexistsuPort {0} deleted.ucomment_port_deleteduUnable to delete port {0}.ucomment_port_notdeleteduPort named {0} may exist.uolduDeleted port {0}.unewuchanges_port_deletedutestuopenvswitch.port_removetbrtport(N(RRRRR R(RR!RR$RR
tport_remove((s@/usr/lib/python2.7/site-packages/salt/states/openvswitch_port.pytabsent�sR
"		









N(t__doc__t
__future__RRRtsalt.extRRR RR)R-(((s@/usr/lib/python2.7/site-packages/salt/states/openvswitch_port.pyt<module>s
	�

Zerion Mini Shell 1.0