+
    ˜qgjg  ã                   óž   € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ]P                  ! ]4      tR R lt ! R R	4      tR# )
z#A module for common socket helpers.N)Úsuppress)ÚDict)Úperformance)ÚDEFAULT_RUN_DIRc                ó$   € V ^8„  d   QhR\         /# )é   Úmessage©Ústr)Úformats   "Ú2/usr/lib/python3/dist-packages/cloudinit/socket.pyÚ__annotate__r      s   € ÷ .ñ .”sñ .ó    c                óJ  € \         P                  P                  RR4      pV'       g   R# V^ ,          R8X  d   VP                  RR^4       MV^ ,          R8w  d   \	        R4      h\
        P
                  ! \
        P                  \
        P                  \
        P                  ,          4      ;_uu_ 4       p\        P                  R\        V 4      4       VP                  V4       VP                  V P                  R	4      4       RRR4       R#   + '       g   i     R# ; i)
zSSend a sd_notify message.

:param message: sd-notify message (must be valid ascii)
ÚNOTIFY_SOCKETÚ NÚ@Ú Ú/zUnsupported socket typezSending sd_notify(%s)Úascii)ÚosÚenvironÚgetÚreplaceÚOSErrorÚsocketÚAF_UNIXÚ
SOCK_DGRAMÚSOCK_CLOEXECÚLOGÚinfor
   ÚconnectÚsendallÚencode)r   Úsocket_pathÚsocks   &  r   Ú	sd_notifyr&      sÍ   € ô
 —*‘*—.‘. °"Ó5€Kçáà	�Q�˜3Ô	à×Ñ˜C  qÕ)ð 
�Q�˜3Ô	ÜÐ/Ó0Ð0ä	�ŠÜ�‰œ×)Ñ)¬F×,?Ñ,?Õ?÷
ô 
à	Ü�‰Ð(¬#¨g«,Ô7Ø�‰�[Ô!Ø�‰�W—^‘^ GÓ,Ô-÷
÷ 
÷ 
ò 
ús   Â6ADÄD"	c                   óT   a € ] tR t^+t o RtV 3R lR ltV 3R lR ltR tR tRt	V t
R	# )
Ú
SocketSyncz<A two way synchronization protocol over Unix domain sockets.c                ó    <€ V ^8„  d   QhRS[ /# )r   Únamesr	   )r   Ú__classdict__s   "€r   r   ÚSocketSync.__annotate__.   s   ø€ ÷ ñ ™sñ r   c           	     ó„  € RV n         RV n        ^ V n        RV n        V Uu/ uFL  pV\        P                  ! \        P
                  \        P                  \        P                  ,          4      bKN  	  upV n        / V n	        \        P                  ! \         R2RRR7       V P                  P                  4        Fh  w  r#\         RV R2p\        \        4      ;_uu_ 4        \        P                   ! V4       R	R	R	4       VP#                  V4       VP%                  4        Kj  	  R	# u upi   + '       g   i     L<; i)
a6  Initialize a synchronization context.

1) Ensure that the socket directory exists.
2) Bind a socket for each stage.

Binding the sockets on initialization allows receipt of stage
"start" notifications prior to the cloud-init stage being ready to
start.

:param names: stage names, used as a unique identifiers
r   Fz/shareiÀ  T)ÚmodeÚexist_okz/share/z.sockN)ÚstageÚfirst_exceptionÚsystemd_exit_codeÚexperienced_any_errorr   r   ÚSOCK_STREAMr   ÚsocketsÚconnectionsr   Úmakedirsr   Úitemsr   ÚFileNotFoundErrorÚremoveÚbindÚlisten)Úselfr*   Únamer%   r$   s   &*   r   Ú__init__ÚSocketSync.__init__.   s   € ð ˆŒ
Ø!ˆÔØ!"ˆÔØ%*ˆÔ"ñ
 ó	
ñ �ð ”&—-’-Ü—‘¤× 2Ñ 2´V×5HÑ5HÕ Hóò ñ ñ	
ˆŒð 68ˆÔä
�Š”Ð' vÐ.°UÀTÕJàŸ,™,×,Ñ,Ö.‰JˆDÜ,Ð-¨W°T°F¸%Ð@ˆKÜÔ+×,Õ,Ü—	’	˜+Ô&÷ -à�I‰I�kÔ"Ø�K‰KŽMó /ùò
÷ -×,ús   ¡AD*Ã$D/Ä/D?c                ó    <€ V ^8„  d   QhRS[ /# )r   r0   r	   )r   r+   s   "€r   r   r,   O   s   ø€ ÷ ñ ™cñ r   c                óN   € WP                   9  d   \        RV 24      hWn        V # )a>  Set the stage before entering context.

This enables the context manager to be initialized separately from
each stage synchronization.

:param stage: the name of a stage to synchronize

Example:
    sync = SocketSync("stage 1", "stage 2"):
    with sync("stage 1"):
        pass
    with sync("stage 2"):
        pass
zInvalid stage name: )r5   Ú
ValueErrorr0   )r=   r0   s   &&r   Ú__call__ÚSocketSync.__call__O   s+   € ð Ÿ™Ô$ÜÐ3°E°7Ð;Ó<Ð<ØŒ
Øˆr   c                ó¼  € \         P                  ! \        P                  P	                  4       4      '       d   \
        P                  R4       R# ^ V n        \        RV P                   R24       V P                  V P                  ,          p\        P                  ! RV P                   24      ;_uu_ 4        VP                  4       w  r#VP                  ^4      w  rCW P                  V P                  &   RRR4       RX8w  d,   V P!                  RRR4       \#        R\%        V4       R24      h\        R	V P                   R
24       V #   + '       g   i     L]; i)zwWait until a message has been received on this stage's socket.

Once the message has been received, enter the context.
z:Stdin is a tty, so skipping stage synchronization protocolNzDSTATUS=Waiting on external services to complete before starting the z stage.zWaiting to start stage s   startzReceived invalid message: [Ú]zSTATUS=Running (z stage))r   ÚisattyÚsysÚstdinÚfilenor   r    r2   r&   r0   r5   r   ÚTimedÚacceptÚrecvfromr6   Ú__exit__rC   r
   )r=   r%   Ú
connectionÚ_Úchunks   &    r   Ú	__enter__ÚSocketSync.__enter__c   s  € ô
 �9Š9”S—Y‘Y×%Ñ%Ó'×(Ò(Ü�H‰HØLôñ Ø!"ˆÔÜð,Ø,0¯J©J¨<°wð@ô	
ð �|‰|˜DŸJ™JÕ'ˆÜ×ÒÐ!8¸¿¹¸ÐE×FÕFØ ŸK™K›M‰MˆJØ!×*Ñ*¨1Ó-‰HˆEØ+5×Ñ˜TŸZ™ZÑ(÷ Gð
 �uÔà�M‰M˜$  dÔ+ÜÐ:¼3¸u»:¸,ÀaÐHÓIÐIäÐ$ T§Z¡Z L°Ð8Ô9Øˆ÷ G×Fús   Â8>EÅE	c                óˆ  € \         P                  ! \        P                  P	                  4       4      '       d   R# RV P
                   2pV'       df   ^V n        RV n        \        V4       RVP                   2pRpV P                  '       g   WPn
        \        P                  V4       \        RV 24       V P                  ;'       g    \        V P                  4      V n        V P                  V P
                  ,          pVP!                  RV RV P                   R	2P#                  4       4       VP%                  4        R# )
z.Notify the socket that this stage is complete.Nz,Completed socket interaction for boot stage Tz in zkfatal error, run "systemctl status cloud-init-main.service" and "cloud-init status --long" for more detailszSTATUS=zecho 'z'; exit Ú;)r   rH   rI   rJ   rK   r0   r2   r3   ÚreprÚtb_framer1   r   Úfatalr&   Úboolr6   r"   r#   Úclose)r=   Úexc_typeÚexc_valÚexc_tbr   Ústatusr%   s   &&&&   r   rO   ÚSocketSync.__exit__…   s  € ä�9Š9”S—Y‘Y×%Ñ%Ó'×(Ò(áØ@ÀÇÁÀÐMˆßà%&ˆDÔ"Ø)-ˆDÔ&Ü˜W›� d¨6¯?©?Ð*;Ð<ˆFðBð ð ×'×'Ð'Ø'-Ô$Ü�I‰I�fÔÜ˜ ˜xÐ(Ô)à%)×%?Ñ%?÷ &
ð &
Ä4Ø×"Ñ"óD
ˆÔ"ð ×Ñ §
¡
Õ+ˆð
 	�‰Ø�W�I˜X d×&<Ñ&<Ð%=¸QÐ?×FÑFÓHô	
ð 	�
‰
Œñ r   )r6   r3   r1   r5   r0   r2   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r?   rD   rS   rO   Ú__static_attributes__Ú__classdictcell__)r+   s   @r   r(   r(   +   s-   ø‡ € ÙF÷ð ÷Bð ò( ÷D%ð %r   r(   )re   Úloggingr   r   rI   Ú
contextlibr   Útypingr   Ú	cloudinitr   Úcloudinit.settingsr   Ú	getLoggerra   r   r&   r(   © r   r   Ú<module>ro      sA   ðá )Û Û 	Û Û 
Ý Ý å !Ý .à×Ò˜Ó!€õ.÷6ó r   