+
    ˜qgjá-  ã                   ó¨  a € R1 t(0 t R t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt R	R
R].R]RR./t] ^ k RRRRRRR/ R/ RRRR.RR/tRRRRR./RRRRR./R RR!RR.//t]P6                  ! ]4      tR" R# ltR2R$ ltR3R% lt R& R' lt!R( t"R4R) lt# ! R* R+4      t$R5R, lt%R- R. lt&R/ R0 lt'R# )6z-Rsyslog: Configure system logging via rsyslogN)Ú	lifecycleÚsubpÚutil©ÚCloud)ÚConfig)Ú
MetaSchema)ÚALL_DISTROSÚDistro)Úloggers)ÚPER_INSTANCEÚidÚ
cc_rsyslogÚdistrosÚ	frequencyÚactivate_by_schema_keysÚrsyslogÚ
config_dirz/etc/rsyslog.dÚconfig_filenamez20-cloud-config.confÚservice_reload_commandÚautoÚremotesÚconfigsÚ	check_exeÚrsyslogdÚpackagesÚinstall_rsyslogFÚfreebsdz/usr/local/etc/rsyslog.dÚopenbsdzsysutils/rsyslogÚnetbsdz/usr/pkg/etc/rsyslog.dc                ó$   € V ^8„  d   QhR\         /# )é   Údistro)r
   )Úformats   "Ú=/usr/lib/python3/dist-packages/cloudinit/config/cc_rsyslog.pyÚ__annotate__r%   ?   s   € ÷ ñ ¬&ñ ó    c                ó¼   € \         p\        P                  ! \        4      pV P                  V9   d+   \        P
                  ! W!V P                  ,          .RR7      pV# )zßConstruct a distro-specific rsyslog config dictionary by merging
   distro specific changes into base config.

@param distro: String providing the distro class name.
@returns: Dict of distro configurations for ntp clients.
T)Úreverse)ÚDISTRO_OVERRIDESÚcopyÚRSYSLOG_CONFIGÚosfamilyr   ÚmergemanydictÚname)r"   ÚdcfgÚcfgs   &  r$   Údistro_default_rsyslog_configr1   ?   sF   € ô €DÜ
�)Š)”NÓ
#€CØ‡�˜$ÔÜ× Ò  #¨F¯K©KÕ'8Ð!9À4ÔHˆØ€Jr&   c                ó`   € \         P                  ! V4      '       d   R# Vf   R.pV ! V4       R# )aQ  Install rsyslog package if not already installed.

@param install_func: function.  This parameter is invoked with the contents
of the packages parameter.
@param packages: list.  This parameter defaults to ['rsyslog'].
@param check_exe: string.  The name of a binary that indicates the package
the specified package is already installed.
Nr   )r   Úwhich)Úinstall_funcr   r   s   &&&r$   r   r   M   s+   € ô ‡z‚z�)×ÒÙØÒØ�;ˆá�Ör&   c                 óˆ   € VR 8X  d%   V P                  RR4      pV P                  RV4      # \        P                  ! VRR7      # )r   Úrsyslog_svcnamer   z
try-reloadT)Úcapture)Ú
get_optionÚmanage_servicer   )r"   ÚcommandÚservices   && r$   Úreload_syslogr<   ^   sA   € Ø�&ÔØ×#Ñ#Ð$5°yÓAˆØ×$Ñ$ \°7Ó;Ð;Ü�9Š9�W dÔ+Ð+r&   c                ó<   € V ^8„  d   QhR\         R\        R\         /# )r!   r0   r"   Úreturn)Údictr
   )r#   s   "r$   r%   r%   e   s!   € ÷ ,ñ ,”Tð ,¤6ð ,¬dñ ,r&   c                óÄ  € V P                  R/ 4      p\        V4      p\        V P                  R4      \        4      '       dR   \        P
                  ! RRR7       RV P                  R4      /pRV 9   d   V R,          VR&   RV 9   d   V R,          VR	&   R. \        3R	VR	,          \        3RVR,          \        3R
VR
,          \        3RVR,          \        \        33RVR,          \        3RVR,          \        3RVR,          \        33pV FM  w  rVpWR9  d   WbV&   K  \        W%,          V4      '       d   K,  \        RV RV R\        W%,          4       24      h	  V# )zœReturn an updated config.

Support converting the old top level format into new format.
Raise a `ValueError` if some top level entry has an incorrect type.
r   z)The rsyslog key with value of type 'list'z22.2)Ú
deprecatedÚdeprecated_versionr   Úrsyslog_filenamer   Úrsyslog_dirr   r   r   r   r   r   zInvalid type for key `z`. Expected type(s): z. Current type: )Úgetr1   Ú
isinstanceÚlistr   Ú	deprecateÚstrr?   ÚboolÚ
ValueErrorÚtype)r0   r"   ÚmycfgÚdistro_configÚfillupÚkeyÚdefaultÚvtypess   &&      r$   Úload_configrS   e   s}  € ð �G‰G�I˜rÓ"€EÜ1°&Ó9€Mä�#—'‘'˜)Ó$¤d×+Ò+Ü×ÒØBØ%õ	
ð ˜CŸG™G IÓ.Ð/ˆØ Ô$Ø'*Ð+=Õ'>ˆEÐ#Ñ$Ø˜CÔØ"% mÕ"4ˆE�,Ñð 
�BœÐØ	�} \Õ2´CÐ8Ø	˜MÐ*;Õ<¼cÐBØ	�M )Õ,¬dÐ3à$ØÐ2Õ3Ü”$ˆKð	
ð
 
�m KÕ0´#Ð6Ø	�] :Õ.´Ð5Ø	˜MÐ*;Õ<¼dÐCð€Fó !'Ñˆ�fØÔØ �#‹JÜ˜E�J¨×/Ô/ÜØ(¨¨Ð-BÀ6À(ð K!Ü!% e¥jÓ!1Ð 2ð4óð ñ	 !'ð €Lr&   c                 ó¤  € . p\        V 4       EF  w  rE\        V\        4      '       dC   R V9  d    \        P	                  RV^,           4       KB  VR ,          pVP                  RV4      pMTpTpVP                  4       pV'       g    \        P	                  RV^,           4       K™  \        P                  P                  W'4      pRpWs9  d   RpVP                  V4        Rp	VP                  R4      '       g   Rp	\        P                  ! WvV	,           VR7       EK  	  V#   \         d"    \        P                  ! \        R	T4        EK@  i ; i)
Úcontentz%No 'content' entry in config entry %sÚfilenamezEntry %s has an empty filenameÚabÚwbÚ Ú
)ÚomodezFailed to write to %s)Ú	enumeraterF   r?   ÚLOGÚwarningrE   ÚstripÚosÚpathÚjoinÚappendÚendswithr   Ú
write_fileÚ	ExceptionÚlogexc)
r   Ú	def_fnameÚcfg_dirÚfilesÚcur_posÚentrU   rV   r[   Úendls
   &&&       r$   Úapply_rsyslog_changesrn   ”   s&  € ð €EÜ! '×*‰ˆÜ�cœ4× Ò Ø Ô#Ü—‘Ø;¸WÀq½[ôñ Ø˜)•nˆGØ—w‘w˜z¨9Ó5‰HàˆGØ ˆHà—>‘>Ó#ˆßÜ�K‰KÐ8¸'ÀA½+ÔFÙä—7‘7—<‘< Ó2ˆð ˆØÔ ØˆEØ�L‰L˜Ô"ð	@ØˆDØ×#Ñ# D×)Ò)Ø�Ü�OŠO˜H°¥n¸E×BÐBñ= +ðD €Løô ô 	@Ü�KŠKœÐ4°h×?Ð?ð	@ús   Ã"D#Ã;!D#Ä#'EÅEc                 ó  €  \         P                  ! R V 4      w  r#VP                  4       pVP                  4       P                  4       pRp\	        V4      ^8X  d   TpM'\	        V4      ^8X  d   Vw  rVM\        RV,          4      h\         P
                  ! RV4      pV'       g   \        RV,          4      hVP                  R4      pVP                  R4      ;'       g    VP                  R4      pVP                  R4      p	VP                  R	4      '       d*   VP                  R
4      '       g   \        RV,          4      hV'       d   V'       g   Tp\        WWxV	R7      p
V
P                  4        V
#   \         d    T Rr2 ELZi ; i)z[ ]*[#]+[ ]*Nzline had multiple spaces: %sz_^(?P<proto>[@]{0,2})(([\[](?P<bracket_addr>[^\]]*)[\]])|(?P<addr>[^:]*))([:](?P<port>[0-9]+))?$zInvalid host specification '%s'ÚprotoÚaddrÚbracket_addrÚportÚ[Ú]z"host spec had invalid brackets: %s©r.   Úmatchrp   rq   rs   )ÚreÚsplitr_   rK   Úlenrw   ÚgroupÚ
startswithrd   ÚSyslogRemotesLineÚvalidate)Úliner.   ÚdataÚcommentÚtoksrw   Ú	host_portrp   rq   rs   Úts   &&         r$   Úparse_remotes_liner…   ½   sP  € ð%ÜŸš °$Ó7‰ˆØ—-‘-“/ˆð �:‰:‹<×ÑÓ€DØ€EÜ
ˆ4ƒy�A„~Ø‰	Ü	ˆT‹�aŒØÑˆˆyäÐ7¸$Õ>Ó?Ð?ä�8Š8ð	#ð 	ó	€D÷ ÜÐ:¸YÕFÓGÐGà�J‰J�wÓ€EØ�:‰:�fÓ×;Ð; §¡¨NÓ!;€DØ�:‰:�fÓ€Dà‡��s×Ò D§M¡M°#×$6Ò$6ÜÐ=ÀÕDÓEÐEç—tØˆäØ e¸Tô	€Að ‡J�J„LØ€HøôI ô %Ø˜t‹gð%ús   ‚)E4 Å4FÆFc                   ó<   a € ] tR t^èt o RR ltR tR tR tRtV t	R# )r}   Nc                ó¾   € V'       g   R pWn         W n        V'       g   RpVR8X  d   RpM	VR8X  d   RpW0n        W@n        Ve   \	        V4      V n        R# RV n        R# )z*.*ÚudpÚ@ú@@ÚtcpN)r.   rw   rp   rq   Úintrs   )Úselfr.   rw   rp   rq   rs   s   &&&&&&r$   Ú__init__ÚSyslogRemotesLine.__init__é   sV   € ÷ ØˆEØŒ	ØŒ
ßØˆEØ�CŒ<Ø‰EØ�dŒ]ØˆEØŒ
àŒ	Ø!%Ò!1”C˜“IˆŽ	°tˆŽ	r&   c                óð   € V P                   '       d    \        V P                   4       V P                  '       g   \        R4      hR#   \         d#   p\        R T P                   ,          4      ThRp?ii ; i)zport '%s' is not an integerNzaddress is required)rs   rŒ   rK   rq   )r�   Úes   & r$   r~   ÚSyslogRemotesLine.validateû   se   € Ø�9�9ˆ9ðÜ�D—I‘I”ð �y�yˆyÜÐ2Ó3Ð3ñ øô ô Ü Ø1°D·I±IÕ=óàðûðús   ”A ÁA5ÁA0Á0A5c                ó”   € R V P                   : RV P                  : RV P                  : RV P                  : RV P                  : R2# )z[name=z match=z proto=z	 address=z port=ru   rv   )r�   s   &r$   Ú__repr__ÚSyslogRemotesLine.__repr__  s/   � à�IŒIØ�JŒJØ�JŒJØ�IŒIØ�IŒIð
ð 	
r&   c                óÐ  € V P                   R ,           pV P                  R8X  d   VR,          pMV P                  R8X  d
   VR,          pRV P                  9   d#   VRV P                  ,           R,           ,          pMWP                  ,          pV P                  '       d   VRV P                  ,          ,          pV P                  '       d   VR	V P                  ,          ,          pV# )
Ú rˆ   r‰   r‹   rŠ   Ú:rt   ru   z:%sz # %s)rw   rp   rq   rs   r.   )r�   Úbufs   & r$   Ú__str__ÚSyslogRemotesLine.__str__  s¦   € Ø�j‰j˜3ÕˆØ�:‰:˜ÔØ�3�J‰CØ�Z‰Z˜5Ô Ø�4�KˆCà�$—)‘)ÔØ�3˜Ÿ™•? SÕ(Õ(‰Cà—9‘9ÕˆCà�9�9ˆ9Ø�5˜4Ÿ9™9Õ$Õ$ˆCà�9�9ˆ9Ø�7˜TŸY™YÕ&Õ&ˆCØˆ
r&   )rq   rw   r.   rs   rp   )NNNNN)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rŽ   r~   r”   rš   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r$   r}   r}   è   s   ø‡ € ô<ò$
4ò
÷ð r&   r}   c           
      óŽ  € V '       g   R # . pVe   VP                  V4       V P                  4        F4  w  rEV'       g   K   VP                  \        \        WTR7      4      4       K6  	  Ve   VP                  V4       RP                  V4      R,           #   \         d#   p\
        P                  RYET4        R p?K�  R p?ii ; i)N)r.   z!failed loading remote %s: %s [%s]rZ   )rc   ÚitemsrI   r…   rK   r]   r^   rb   )r   ÚheaderÚfooterÚlinesr.   r   r‘   s   &&&    r$   Úremotes_to_rsyslog_cfgr¨   $  s¤   € ßÙØ€EØÒØ�‰�VÔØ—m‘m–o‰
ˆßÙð	LØ�L‰LœÔ/°Ô@ÓAÖBñ	 &ð ÒØ�‰�VÔØ�9‰9�UÓ˜dÕ"Ð"øô	 ô 	LÜ�K‰KÐ;¸TÈ×KÒKûð	Lús   Á$BÂCÂ"B?Â?Cc                ó(   € V ^8„  d   QhR\         RR/# )r!   Úcloudr>   Nr   )r#   s   "r$   r%   r%   6  s   € ÷ 
ñ 
¬Eð 
°dñ 
r&   c                óØ  €  V P                   P                  RR4       T P                   P                  RR4       T P                   P	                  4        \
        P                  ! \        P                  4      ;_uu_ 4        T P                   P                  RR4       \        P                  R4       RRR4       R#   \        P                   d     R# i ; i  + '       g   i     R# ; i)z½
This helper function bundles the necessary steps to disable BSD base syslog
``rc(8)`` reads its configuration on start, so after disabling syslogd, we
need to tell rc to reload its config
ÚenabledÚsyslogdNÚdisableÚonestopzOsyslogd is running before cloud-init! Please report this as bug to the porters!)	r"   r9   r   ÚProcessExecutionErrorÚreload_initÚ
contextlibÚsuppressr]   Úerror)rª   s   &r$   Ú disable_and_stop_bsd_base_syslogrµ   6  s­   € ðØ�‰×#Ñ# I¨yÔ9ð 
‡L�L×Ñ 	¨9Ô5Ø	‡L�L×ÑÔä	×	Ò	œT×7Ñ7×	8Õ	8ð 	�‰×#Ñ# I¨yÔ9Ü�	‰	ð8ô	
÷ 
9Ñ	8øô ×%Ñ%ô Úðú÷
 
9×	8Ð	8ús   ‚B< Â 2CÂ<CÃCÃC)	c          
      óL   € V ^8„  d   QhR\         R\        R\        R\        RR/# )r!   r.   r0   rª   Úargsr>   N)rI   r   r   rG   )r#   s   "r$   r%   r%   N  s/   € ÷ =;ñ =;”ð =;œ6ð =;¬%ð =;´tð =;Àñ =;r&   c                 óZ  € R V9  d   \         P                  RV 4       R# \        WP                  4      pVR,          pVR,          '       d%   VP	                  \        VR,          RRR7      4       VP                  P                  RR 4      pVR	,          R
J d1   \        VP                  P                  VR,          VR,          R7       \        P                  ! 4       '       d(   VP                  P                  RV4       \        V4       VR,          '       g   \         P                  R4       R# \        VR,          VR,          VR,          R7      pV'       g   \         P                  R4       R#  \        VP                  VR,          R7      pV'       dN   \&        P(                  ! 4        \&        P*                  ! VP,                  4       \         P                  RW4       R# R#   \        P                    d,   p	Rp\         P#                  R\%        T	4      4        Rp	?	L’Rp	?	ii ; i)r   z;Skipping module named %s, no 'rsyslog' key in configurationNr   r   z# begin remotesz# end remotes)r¥   r¦   r6   r   Tr   r   )r   r   Úenablez.Empty config rsyslog['configs'], nothing to dor   r   )r   rh   ri   z0restart of syslog not necessary, no changes mader   )r:   FzFailed to reload syslog %sz%s configured %s files)r]   ÚdebugrS   r"   rc   r¨   r8   r   Úinstall_packagesr   Úis_BSDr9   rµ   rn   r<   r   r°   r^   rI   r   Úreset_loggingÚsetup_loggingr0   )
r.   r0   rª   r·   rM   r   r;   ÚchangesÚ	restartedr‘   s
   &&&&      r$   ÚhandlerÁ   N  s¹  € Ø˜ÔÜ�	‰	ØIÈ4ô	
ñ 	ä˜Ÿ\™\Ó*€EØ�IÕ€GàˆY×ÔØ�‰Ü"Ø�iÕ Ø(Ø&ôô	
ð �l‰l×%Ñ%Ð&7¸ÓC€GàÐÕ 4Ó'ÜØ�L‰L×)Ñ)Ø˜:Õ&Ø˜KÕ(õ	
ô ‡{‚{‡}‚}Ø�‰×#Ñ# H¨gÔ6Ü(¨Ô/à�×ÔÜ�	‰	ÐBÔCÙä#Ø�iÕ ØÐ)Õ*Ø�lÕ#ô€G÷ Ü�	‰	ÐDÔEÙð:Ü!Ø�L‰L %Ð(@Õ"Aô
ˆ	÷ ô 	×ÒÔÜ×Ò˜eŸi™iÔ(ô 	�	‰	Ð*¨DÖ:ñ øô	 ×%Ñ%ô :Øˆ	Ü�‰Ð0´#°a³&×9Ñ9ûð:ús   Å5G* Ç*H*Ç?!H%È%H*c                ó@   € V ^8„  d   Qh/ ^ \         9   d
   \        ;R&   # )r!   Úmeta)Ú__conditional_annotations__r   )r#   s   "r$   r%   r%      s   € × 3Ñ 3÷ ò „jñ ò! 4r&   )Nr   )r   )N)NN))rÄ   Ú__doc__r²   r*   Úloggingr`   rx   Ú	cloudinitr   r   r   Úcloudinit.cloudr   Úcloudinit.configr   Úcloudinit.config.schemar   Úcloudinit.distrosr	   r
   Úcloudinit.logr   Úcloudinit.settingsr   rÃ   r+   r)   Ú	getLoggerrœ   r]   r1   r   r<   rS   rn   r…   r}   r¨   rµ   rÁ   r%   )rÄ   s   @r$   Ú<module>rÏ      s+  øðö 4ã Û Û Û 	Û 	ç +Ñ +Ý !Ý #Ý .ß 1Ý !Ý +ð 	ˆ,Ø�ˆ}Ø�Ø 	˜{ð	€ó ð Ð"ØÐ-Ø˜fØˆrØˆrØ�Ø��Ø�uð	€ð ØÐ0Ø�Y�Kðð ØÐ0ØÐ'Ð(ðð ØÐ.ØÐ'Ð(ððÐ ð ×Ò˜Ó!€õôô",õ,ò^&ôR(÷V9ñ 9ôx#õ$
÷0=;r&   