Viewing File: /usr/lib/python2.7/site-packages/cloudinit/config/cc_phone_home.pyc

ó
oBú]c@sqdZddlmZddlmZddlmZddlmZeZdddd	d
dgZd„Z	d
S(sŰ
Phone Home
----------
**Summary:** post data to url

This module can be used to post data to a remote host after boot is complete.
If the post url contains the string ``$INSTANCE_ID`` it will be replaced with
the id of the current instance. Either all data can be posted or a list of
keys to post. Available keys are:

    - ``pub_key_dsa``
    - ``pub_key_rsa``
    - ``pub_key_ecdsa``
    - ``instance_id``
    - ``hostname``
    - ``fdqn``

**Internal name:** ``cc_phone_home``

**Module frequency:** per instance

**Supported distros:** all

**Config keys**::

    phone_home:
        url: http://example.com/$INSTANCE_ID/
        post:
            - pub_key_dsa
            - instance_id
            - fqdn
        tries: 10
i˙˙˙˙(t	templater(t
url_helper(tutil(tPER_INSTANCEtpub_key_dsatpub_key_rsat
pub_key_ecdsatinstance_idthostnametfqdncCsÁt|ƒdkr(tj|dƒ}n*d|krH|jd|ƒdS|d}d|krr|jd|ƒdS|d}|jddƒ}|jdƒ}yt|ƒ}Wn*tk
rŮd	}tj|d
|ƒnX|dkrďt	}ni}	|j
ƒ|	d<|jƒ|	d<|jd
tƒ|	d
<idd6dd6dd6}
xX|
j
ƒD]J\}}ytj|ƒ|	|<WqStk
rœtj|d|ƒqSXqSWi}
xE|D]=}||	krŃ|	||
|<qŽd|
|<|jd|ƒqŽWi}xC|
j
ƒD]5\}}|dkr'd||<qt|ƒ||<qWi|	dd6}tj||ƒ}y5tj|d|d|dddtj|jƒƒWn'tk
rźtj|d||ƒnXdS(Nit
phone_homes=Skipping module named %s, no 'phone_home' configuration foundturlsFSkipping module named %s, no 'url' found in 'phone_home' configurationtposttallttriesi
s?Configuration entry 'tries' is not an integer, using %s insteadRRR	s/etc/ssh/ssh_host_dsa_key.pubRs/etc/ssh/ssh_host_rsa_key.pubRs/etc/ssh/ssh_host_ecdsa_key.pubRs1%s: failed to open, can not phone home that data!s=Requested key %s from 'post' configuration list not availablesN/AtINSTANCE_IDtdatatretriestsec_betweenitssl_detailss0Failed to post phone home data to %s in %s tries(tlenRt	read_conftdebugtwarningtgettintt	Exceptiontlogexct
POST_LIST_ALLtget_instance_idtget_hostnametTruetitemst	load_filetNonetstrRt
render_stringRtread_file_or_urltfetch_ssl_detailstpaths(tnametcfgtcloudtlogtargstph_cfgRt	post_listRtall_keystpubkeystntpathtsubmit_keystktreal_submit_keystvt
url_params((sB/usr/lib/python2.7/site-packages/cloudinit/config/cc_phone_home.pythandleGst	
	

	



	

N(
t__doc__t	cloudinitRRRtcloudinit.settingsRt	frequencyRR8(((sB/usr/lib/python2.7/site-packages/cloudinit/config/cc_phone_home.pyt<module>)s	
Back to Directory File Manager