
    x[h              
           % S r SSKrSSKJrJrJr  SSKJr  SSKJ	r	  SSK
Jr  SSKJr  SSKJr  / S	QrS
\/\S/S.r\\S'   \R&                  " \5      rS\S\	S\S\SS4
S jrg)zPhone Home: Post data to url    N)	templater
url_helperutil)Cloud)Config)
MetaSchema)ALL_DISTROS)PER_INSTANCE)pub_key_rsapub_key_ecdsapub_key_ed25519instance_idhostnamefqdncc_phone_home
phone_home)iddistros	frequencyactivate_by_schema_keysmetanamecfgcloudargsreturnc           	         U(       a  [         R                  " US   5      nO"SU;  a  [        R                  SU 5        g US   nSU;  a  [        R	                  SU 5        g US   nUR                  SS5      nUR                  S5      n [        U5      nUS:X  a  [        nUR                  5       UR                  5       R                  UR                  SS9R                  S.nSSSS.n	U	R                  5        H  u  p [         R                  " U5      X'   M      0 nU H*  nX;   a  X   X'   M  S X'   [        R	                  SU5        M,     0 nUR                  5        H  u  pUc  SX'   M  [#        U5      X'   M     SUS   0n[$        R&                  " UU5      n [(        R*                  " UUUS-
  S[         R,                  " UR.                  5      S9  g ! [        [        4 a"    S	n[         R                  " [        S
U5         GNtf = f! [          a!    [         R                  " [        SU5         GM=  f = f! [          a    [         R                  " [        SXW5         g f = f)Nr   r   z=Skipping module named %s, no 'phone_home' configuration foundurlzFSkipping module named %s, no 'url' found in 'phone_home' configurationpostalltries
   z?Configuration entry 'tries' is not an integer, using %s insteadT)r   )r   r   r   z/etc/ssh/ssh_host_rsa_key.pubz/etc/ssh/ssh_host_ecdsa_key.pubz!/etc/ssh/ssh_host_ed25519_key.pub)r   r   r   z1%s: failed to open, can not phone home that data!z=Requested key %s from 'post' configuration list not availablezN/AINSTANCE_IDr         )dataretriessec_betweenssl_detailsz0Failed to post phone home data to %s in %s tries)r   	read_confLOGdebugwarninggetint
ValueError	TypeErrorlogexcPOST_LIST_ALLget_instance_idget_hostnamer   itemsload_text_file	Exceptionstrr   render_stringr   read_file_or_urlfetch_ssl_detailspaths)r   r   r   r   ph_cfgr   	post_listr!   all_keyspubkeysnpathsubmit_keyskreal_submit_keysv
url_paramss                    @/usr/lib/python3/dist-packages/cloudinit/config/cc_phone_home.pyhandlerJ   1   so   Q(s"II6
 \"F;	

 	
-C

65)IJJwE
E
 E!	 ,,.&&(11"""-66H 7:>G ==?	--d3HK # K=%[KN!KNKK4  !!#9"'"%a&	 $ 	x.J 
!
!#z
2C
##!AI..u{{;	
s 	" 
M	

4  	KKH$ 	L  
CS	

s6   
G  H9H; .H
	H
&H87H8;&I$#I$)__doc__logging	cloudinitr   r   r   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.distrosr	   cloudinit.settingsr
   r3   r   __annotations__	getLogger__name__r+   r9   listrJ        rI   <module>rY      s    #  1 1 ! # . ) + } ,~	j  !]
 ]
6 ]
% ]
t ]
 ]
rX   