ó 'KXc@s¶ddlZddlmZddlmZddlmZddlmZddlmZeZ dZ dZ d gZ iid d 6d d 6dd6dd6d6Z d„Zd„ZdS(iÿÿÿÿN(tStringIO(t ConfigObj(t type_utils(tutil(t PER_INSTANCEs/etc/landscape/client.confs/etc/default/landscape-clienttubuntutinfot log_levels.https://landscape.canonical.com/message-systemturls#http://landscape.canonical.com/pingtping_urls/var/lib/landscape/clientt data_pathtclientc Csð|jdiƒ}t|tƒs<tdtj|ƒƒ‚n|sFdS|jjd ƒtt |g}t |ƒ}t ƒ}|j |ƒt jtjjt ƒƒt jt |jƒƒ|jdt ƒt jtdƒt jdddgƒdS( s¬ Basically turn a top level 'landscape' entry with a 'client' dict and render it to ConfigObj format under '[client]' section in /etc/landscape/client.conf t landscapesM'landscape' key existed in config, but not a dictionary type, is a %s insteadNslandscape-clients!Wrote landscape config file to %ssRUN=1 tservicetrestart(slandscape-client(tgett isinstancetdictt RuntimeErrorRtobj_nametdistrotinstall_packagestLSC_BUILTIN_CFGtLSC_CLIENT_CFG_FILEtmerge_togetherRtwriteRt ensure_dirtostpathtdirnamet write_filetgetvaluetdebugtLS_DEFAULT_FILEtsubp( t_nametcfgtcloudtlogt_argst ls_cloudcfgt merge_datatmergedtcontents((sJ/opt/freeware/lib/python2.7/site-packages/cloudinit/config/cc_landscape.pythandle2s$    cCs_tiƒ}xL|D]D}|s%qnt|tƒrD|j|ƒq|jt|ƒƒqW|S(su merge together ConfigObj objects or things that ConfigObj() will take in later entries override earlier (RRtmerge(tobjsR$tobj((sJ/opt/freeware/lib/python2.7/site-packages/cloudinit/config/cc_landscape.pyRVs  (RRt configobjRt cloudinitRRtcloudinit.settingsRt frequencyRR!tdistrosRR,R(((sJ/opt/freeware/lib/python2.7/site-packages/cloudinit/config/cc_landscape.pyts"   $