ó
    /I_  ã                   óp   • S SK r  S SKJr  S SKJr   " S S\5      r	g! \\4 a    S SKJr  S SKJr   N"f = f)é    N)Úutils)Ú
moduleBasec            	       ó„   • \ rS rSrSrSSSS.SSS.SSS.S	SS.S
SS.SSS.S.S.rS rS r\\\\\\\S.rS r	SS jr
Srg)Úusercmdsé   z<ifupdown2 addon module to configure user specified commands zuser commands for interfacesz,run command before bringing the interface upT)ÚhelpÚ	multilinez!run command at interface bring upz$run command after interface bring upz.run command before bringing the interface downzrun command at interface downz)run command after bringing interface down©úpre-upÚupúpost-upúpre-downÚdownú	post-down)ÚmhelpÚattrsc                 ó  • UR                  U5      nU(       að  UR                  (       a  UR                  OS[        R                  S'   UR                  (       a  UR                  OS[        R                  S'   UR                  (       a  UR                  OS[        R                  S'   UR
                  (       a  SR                  UR
                  5      OS[        R                  S'   U H  n [        R                  " U5        M     g g ! [         ar  nU R                  [        U5      5      (       dH  U R                  R                  UR                  < SU< S[        U5      R                  S	5      < 35         S nAM—  S nAff = f)
NÚ ÚIFACEÚLOGICALÚMETHODÚ,ÚADDRFAMz: Ú Ú
)Úget_attr_valueÚnameÚosÚenvironÚaddr_methodÚaddr_familyÚjoinr   Úexec_user_commandÚ	ExceptionÚignore_errorÚstrÚloggerÚwarningÚstrip)ÚselfÚifaceobjÚopÚcmd_listÚcmdÚes         Ú'/usr/share/ifupdown2/addons/usercmds.pyÚ_run_commandÚusercmds._run_command+   s  € Ø×*Ñ*¨2Ó.ˆÞØ3;·=·= (§-¢-ÀbŒBJ‰JwÑØ5=·]·] H§M¢MÈŒBJ‰JyÑ!Ø;C×;O×;O 8×#7Ò#7ÐUWŒBJ‰JxÑ ØFN×FZ×FZ C§H¡H¨X×-AÑ-AÔ$BÐ`bŒBJ‰JyÑ!ÛðÜ×+Ò+¨CÖ0ò  ð øô !ó Ø×,Ñ,¬S°«V×4Ñ4ØŸ™×+Ñ+¸8¿=¼=Ë"Ü8;¸A»¿¹ÀTÕ8Jð-Lô Måûð	ús   Ã.D
Ä

FÄA'FÆFc                 ó¤   • UR                   (       a?  S H8  nUR                   R                  U/ 5       H  nUR                  X4S5        M     M:     g g )Nr
   éÿÿÿÿ)ÚconfigÚgetÚupdate_config_with_status)r*   r+   ÚifaceobjcurrÚopsr.   s        r0   Ú_query_checkÚusercmds._query_check;   sG   € Ø??ó%ð $Ÿ?™?×.Ñ.¨s°BÖ7CØ ×:Ñ:¸3ÀRÖHó 8ò%ð ó    )r   r   r   r   r   r   úquery-checkcurrc                 óH   • [        U R                  R                  5       5      $ )z-returns list of ops supported by this module )ÚlistÚ_run_opsÚkeys)r*   s    r0   Úget_opsÚusercmds.get_opsN   s   € äD—M‘M×&Ñ&Ó(Ó)Ð)r<   Nc                 ó|   • U R                   R                  U5      nU(       d  gUS:X  a
  U" XU5        gU" XU5        g)a  run user commands

Args:
    **ifaceobj** (object): iface object

    **operation** (str): list of ops

Kwargs:
    **query_ifaceobj** (object): query check ifaceobject. This is only
        valid when op is 'query-checkcurr'. It is an object same as
        ifaceobj, but contains running attribute values and its config
        status. The modules can use it to return queried running state
        of interfaces. status is success if the running state is same
        as user required state in ifaceobj. error otherwise.
Nr=   )r@   r6   )r*   r+   Ú	operationÚquery_ifaceobjÚ
extra_argsÚ
op_handlers         r0   ÚrunÚusercmds.runR   s;   € ð  —]‘]×&Ñ& yÓ1ˆ
ÞØØÐ)Ó)Ùt ~Õ6át yÕ1r<   © )N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú_modinfor1   r:   r@   rB   rI   Ú__static_attributes__rK   r<   r0   r   r      s›   † ÙHà8ð #QØ'+ñ-ð #FØ'+ñ-ð #IØ'+ñ-ð #SØ'+ñ-ð #BØ'+ñ-ð #NØ'+ñ-ñ#.ñ/€Hò*ò 	Ið (Ø(Ø"Ø'Ø$Ø)Ø".ñ0€Hò*÷2r<   r   )
r   Úifupdown2.ifupdown.utilsr   Ú#ifupdown2.ifupdownaddons.modulebaser   ÚImportErrorÚModuleNotFoundErrorÚifupdown.utilsÚifupdownaddons.modulebaser   rK   r<   r0   Ú<module>rY      s@   ðó 
ð5Ý.å>ôU2ˆzõ U2øð 	Ð(Ð)ó 5Ý$ç4ð5ús   † ž5´5