ó
    ¤“ŽgY  ã                   ó  • S SK Jr  S SKJr  S SKrSSKJrJr   " S S\5      r " S S	\5      r	 " S
 S\5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S  S!\5      r\" S" 5      r\" S# \R0                  \	R2                  \\	R4                  \\	R6                  \0\R8                  \
R:                  \\
R<                  \0\R>                  \" S$ 5      \R@                  \RB                  \\RD                  \0\RF                  \RH                  \0\RJ                  \RL                  \005      r'S% r(S&\)4S' jr*g)(é    )Údefaultdict)ÚIntEnumNé   )ÚffiÚlibc                   ó,   • \ rS rSrSrSrSrSrSrSr	Sr
g	)
ÚNETPLAN_ERROR_DOMAINSé   r   é   é   é   é   é   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__ÚNETPLAN_PARSER_ERRORÚNETPLAN_VALIDATION_ERRORÚNETPLAN_FILE_ERRORÚNETPLAN_BACKEND_ERRORÚNETPLAN_EMITTER_ERRORÚNETPLAN_FORMAT_ERRORÚ__static_attributes__r   ó    Ú0/usr/lib/python3/dist-packages/netplan/_utils.pyr	   r	      s&   † ØÐØ ÐØÐØÐØÐØÓr   r	   c                   ó    • \ rS rSrSrSrSrSrg)ÚNETPLAN_PARSER_ERRORSé$   r   r   r   r   N)r   r   r   r   ÚNETPLAN_ERROR_INVALID_YAMLÚNETPLAN_ERROR_INVALID_CONFIGÚNETPLAN_ERROR_INVALID_FLAGr   r   r   r   r   r   $   s   † Ø!"ÐØ#$Ð Ø!"Ór   r   c                   ó   • \ rS rSrSrSrSrg)ÚNETPLAN_VALIDATION_ERRORSé*   r   r   r   N)r   r   r   r   ÚNETPLAN_ERROR_CONFIG_GENERICÚNETPLAN_ERROR_CONFIG_VALIDATIONr   r   r   r   r%   r%   *   s   † Ø#$Ð Ø&'Ó#r   r%   c                   ó   • \ rS rSrSrSrSrg)ÚNETPLAN_BACKEND_ERRORSé/   r   r   r   N)r   r   r   r   ÚNETPLAN_ERROR_UNSUPPORTEDÚNETPLAN_ERROR_VALIDATIONr   r   r   r   r*   r*   /   s   † Ø !ÐØ Ór   r*   c                   ó   • \ rS rSrSrSrg)ÚNETPLAN_EMITTER_ERRORSé4   r   r   N)r   r   r   r   ÚNETPLAN_ERROR_YAML_EMITTERr   r   r   r   r/   r/   4   s   † Ø!"Ór   r/   c                   ó   • \ rS rSrSrSrg)ÚNETPLAN_FORMAT_ERRORSé8   r   r   N)r   r   r   r   Ú!NETPLAN_ERROR_FORMAT_INVALID_YAMLr   r   r   r   r3   r3   8   s   † Ø()Ó%r   r3   c                   ó$   • \ rS rSrSS jrS rSrg)ÚNetplanExceptioné<   Nc                 ó(   • X l         X0l        Xl        g ©N©ÚdomainÚerrorÚmessage)Úselfr>   r<   r=   s       r   Ú__init__ÚNetplanException.__init__=   s   € ØŒØŒ
Ø�r   c                 ó   • U R                   $ r:   )r>   ©r?   s    r   Ú__str__ÚNetplanException.__str__B   s   € Ø�|‰|Ðr   r;   ©NNN)r   r   r   r   r@   rD   r   r   r   r   r7   r7   <   s   † ôõ
r   r7   c                   ó$   • \ rS rSr\S 5       rSrg)ÚNetplanFileExceptionéF   c                 ó   • U R                   $ r:   )r=   rC   s    r   ÚerrnoÚNetplanFileException.errnoG   s   € à�z‰zÐr   r   N)r   r   r   r   ÚpropertyrK   r   r   r   r   rH   rH   F   s   † Øñó ór   rH   c                   ó4   ^ • \ rS rSrSrSrSU 4S jjrSrU =r$ )ÚNetplanValidationExceptionéL   aè  
Netplan Validation errors are expected to contain the YAML file name
from where the error was found.

A validation error might happen after the parsing stage. libnetplan walks
through its internal representation of the network configuration and checks
if all the requirements are met. For example, if it finds that the key
"set-name" is used by an interface, it will check if "match" is present.
As "set-name" requires "match" to work, it will emit a validation error
if it's not found.
z((?P<file_path>.*\.yaml): (?P<message>.*)c                 óº   >• [         TU ]  XU5        [        R                  " U R                  U5      nU(       d  [        SU 35      eUS   U l        US   U l        g )Nz@The validation error message does not have the expected format: Ú	file_pathr>   )Úsuperr@   ÚreÚmatchÚ!SCHEMA_VALIDATION_ERROR_MSG_REGEXÚ
ValueErrorÚfilenamer>   ©r?   r>   r<   r=   Úschema_errorÚ	__class__s        €r   r@   Ú#NetplanValidationException.__init__]   sX   ø€ Ü‰Ñ˜¨%Ô0ä—x’x × FÑ FÈÓPˆÞäÐ_Ð`gÐ_hÐiÓjÐjà$ [Ñ1ˆŒØ# IÑ.ˆ�r   )rX   r>   rF   )	r   r   r   r   Ú__doc__rV   r@   r   Ú__classcell__©r[   s   @r   rO   rO   L   s   ø† ñ
ð 8ð &÷	/õ 	/r   rO   c                   ó4   ^ • \ rS rSrSrSrSU 4S jjrSrU =r$ )ÚNetplanParserExceptionéi   a˜  
Netplan Parser errors are expected to contain the YAML file name
and line and column numbers from where the error was found.

A parser error might happen during the parsing stage. Parsing errors
might be due to invalid YAML files or invalid Netplan grammar. libnetplan
will check for this kind of issues while it's walking through the YAML
files, so it has access to the location where the error was found.
zN(?P<file_path>.*):(?P<error_line>\d+):(?P<error_col>\d+): (?P<message>(\s|.)*)c                 óâ   >• [         TU ]  XU5        [        R                  " U R                  U5      nU(       d  [        SU 35      eUS   U l        US   U l        US   U l        US   U l	        g )Nz<The parser error message does not have the expected format: rR   Ú
error_lineÚ	error_colr>   )
rS   r@   rT   rU   ÚSCHEMA_PARSER_ERROR_MSG_REGEXrW   rX   ÚlineÚcolumnr>   rY   s        €r   r@   ÚNetplanParserException.__init__x   sr   ø€ Ü‰Ñ˜¨%Ô0ô —x’x × BÑ BÀGÓLˆÞäÐ[Ð\cÐ[dÐeÓfÐfà$ [Ñ1ˆŒØ  Ñ.ˆŒ	Ø" ;Ñ/ˆŒØ# IÑ.ˆ�r   )rh   rX   rg   r>   rF   )	r   r   r   r   r]   rf   r@   r   r^   r_   s   @r   ra   ra   i   s   ø† ñð ^ð "÷/õ /r   ra   c                   ó   • \ rS rSrSrg)ÚNetplanParserFlagsExceptionéŠ   r   N©r   r   r   r   r   r   r   r   rk   rk   Š   ó   † Úr   rk   c                   ó   • \ rS rSrSrg)ÚNetplanBackendExceptionéŽ   r   Nrm   r   r   r   rp   rp   Ž   rn   r   rp   c                   ó   • \ rS rSrSrg)ÚNetplanEmitterExceptioné’   r   Nrm   r   r   r   rs   rs   ’   rn   r   rs   c                   ó   • \ rS rSrSrg)ÚNetplanFormatExceptioné–   r   Nrm   r   r   r   rv   rv   –   rn   r   rv   c                  ó   • [         $ r:   )r7   r   r   r   Ú<lambda>ry   ›   s   € Õ2Br   c                  ó   • [         $ r:   )ÚNETPLAN_EXCEPTIONS_FALLBACKr   r   r   ry   ry   Ÿ   s   € Õ)Dr   c                  ó   • [         $ r:   )rH   r   r   r   ry   ry   ¬   s   € ÕFZr   c                 ór  ^	• [         R                  " S5      n[        U " / UQUP76 5      nU(       d…  US   m	T	[         R                  :X  a  [	        SSS5      e[
        R                  " T	5      nUS-	  n[        [         R                  " SU5      5      n[        U	4S j5      n[        U   U   nU" XuU5      eU$ )NzNetplanError **r   zUnknown erroré    Úuint32_tc                 óF   >• [         R                  " TU [        U 5      5      $ r:   )r   Únetplan_error_messageÚlen)ÚbÚerrs    €r   ry   Ú#_checked_lib_call.<locals>.<lambda>Ç   s   ø€ Ä×@YÒ@YÐZ]Ð_`ÔbeÐfgÓbhÔ@ir   )r   ÚnewÚboolÚNULLr7   r   Únetplan_error_codeÚintÚcastÚ_string_realloc_call_no_errorÚNETPLAN_EXCEPTIONS)
ÚfnÚargsÚrefÚretÚdomain_codeÚerror_domainÚ
error_codeÚerror_messageÚ	exceptionr„   s
            @r   Ú_checked_lib_callr—   ½   s§   ø€ Ü
�'Š'Ð#Ó
$€CÜ
‰rˆ~�4ˆ~˜Š~Ó
€CÞØ�!‰fˆØ”#—(‘(‹?Ü" ?°A°qÓ9Ð9Ü×,Ò,¨SÓ1ˆØ" bÑ(ˆÜœŸš *¨kÓ:Ó;ˆ
Ü5Ô6iÓjˆÜ& |Ñ4°ZÑ@ˆ	Ù˜°ZÓ@Ð@Ø€Jr   Úfunctionc                 ó   • SnUS:  al  [         R                  " SU5      nU " U5      nUS:X  a  US-  nM2  US:  a  [        SU-  5      eUS:X  a  g [         R                  " U5      R	                  S5      $ [        S	5      e)
Né   i   zchar[]éþÿÿÿr   r   zUnknown error: %dzutf-8z&Halting due to string buffer size > 1M)r   r†   r7   ÚstringÚdecode)r˜   ÚsizeÚbufÚcodes       r   rŒ   rŒ   Í   s�   € Ø€DØ
�‹.Ü�gŠg�h Ó%ˆÙ˜‹}ˆØ�2‹:Ø˜!‘8ˆDÙà�!‹8Ü"Ð#6¸Ñ#=Ó>Ð>Ø�Q‹YØä—:’:˜c“?×)Ñ)¨'Ó2Ð2Ü
ÐCÓ
DÐDr   )+Úcollectionsr   Úenumr   rT   Ú_netplan_cffir   r   r	   r   r%   r*   r/   r3   Ú	Exceptionr7   rH   rO   ra   rk   rp   rs   rv   r{   r   r!   r"   r#   r   r'   r(   r   r   r,   r-   r   r1   r   r5   r�   r—   ÚcallablerŒ   r   r   r   Ú<module>r¦      sÅ  ðõ  $Ý Û 	ç #ô˜Gô ô#˜Gô #ô( ô (ô
!˜Wô !ô
#˜Wô #ô*˜Gô *ô�yô ôÐ+ô ô/Ð!1ô /ô:/Ð-ô /ôB	Ð"2ô 	ô	Ð.ô 	ô	Ð.ô 	ô	Ð-ô 	ñ
 *Ñ*BÓCÐ ñ !Ñ!DØ×2Ñ2Ø!×<Ñ<Ð>TØ!×>Ñ>Ð@VØ!×<Ñ<Ð>Yð5ð 	×6Ñ6Ø%×BÑBÐDTØ%×EÑEÐGað9ð 	×0Ñ0±+Ñ>ZÓ2[à×3Ñ3Ø"×<Ñ<Ð>UØ"×;Ñ;Ð=Tð6ð
 	×3Ñ3Ø"×=Ñ=Ð?Vð6ð 	×2Ñ2Ø!×CÑCÐE[ð5ð1G
ó Ð ò<ð E¨Hõ Er   